I think Captain104 has it correct - the person manning the tiller on a boat is the coxswain or cox so the original term was perhaps derived from the combination of cox and pit - thus cox-pit which was modified to cock-pit. Of course I could be talking rollocks or even rowlocks!