First literary reference? Charles Dickens in Dombey and Son.
In sailing, the rudder is used only for basic steerageway. Most Man-of-wars were three masted vessels. The lines attached to the sails that controlled the angle of the sail relative to the wind were called "sheets". If those sheets come loose on a mainsail, then that sail will whip around erratically and be subject to the whims of the wind. Three sheets to the wind and the ship would be impossible to maneuver. Wodin and BlutWump had it right.