Nothing in this Act shall render liable to any penalty or forfeiture the owner or master of any ship or boat, or any carrier or warehouseman, or the person having charge of any carriage, for any act done in breach of this Act, if he prove that by reason of stress of weather, inevitable accident, or other emergency, the doing of such act was, under the circumstances, necessary and proper.