An ultrarunner did not expect his 50-mile run into Yosemite Valley to end with an unwanted bear hug. Here’s what happened.