You can safely attack and withdraw underwater.
Prerequisites: Swim speed, Dex 13, Dodge.
Benefit: After making a single melee attack, you can use the withdraw action (moving up to twice your swim speed) as a move action. You can only use this feat while swimming.
Normal: Withdrawing from combat is a full-round action.
Source: Stormwrack, page 93.