Perceived risk and obstacle avoidance in flying birds