Swim out to sea, then hold down the space bar which keeps you afloat and just wait for dawn.
Hostile mobs will only spawn on solid blocks (ice doesn't count) so you don't have to worry about them.
Just make sure you are sufficiently far from land that they can't spot you. It is better if you make a boat. It is made from 5 blocks of wood planks in a a lowercase U-shape.