Minecraft wiki entry for Bed, associated text: If the player is falling while sleeping requirements are met, and presses use on a bed within reach before hitting the ground, the fall damage is delayed until the player wakes.