Sailor Dialect meaning, essentially: when you're in trouble, any way out is a good way out.
Y'see, back when people
sailed the seven seas with
reckless abandon, a crew was more likely to find the nearest port than to risk ship
and crew in a life-threatening storm. This phrase is probably most applicable to the pirate-sorts, as this phrase suggests that anything is better than getting screwed, and pirates liked that sort
of shady-around-the-edges shiznit.