(3)No customs collector shall clear any such ship outwards without the production of such certificate, and, if any such ship attempts to go to sea without a clearance, the customs collector may detain her until such certificate as aforesaid is produced.