Buddy the pit bull stood on guard and helped police locate a 3-year-old boy who had wandered off into the woods