The appropriate customs officer for the district in which any vessel or vehicle arrives from a foreign port or place may put on board of such vessel or vehicle while within such district, and if necessary while going from one district to another, one or more inspectors or other customs officers to examine the cargo and contents of such vessel or vehicle and superintend the unlading thereof, and to perform such other duties as may be required by law or the customs regulations for the protection of the revenue. Such inspector or other customs officer may, if he shall deem the same necessary for the protection of the revenue, secure the hatches or other communications or outlets of such vessel or vehicle with customs seals or other proper fastenings while such vessel is not in the act of unlading and such fastenings shall not be removed without permission of the inspector or other customs officer. Such inspector or other customs officer may require any vessel or vehicle to discontinue or suspend unlading during the continuance of unfavorable weather or any conditions rendering the discharge of cargo dangerous or detrimental to the revenue. Any officer, owner, agent of the owner, or member of the crew of any such vessel who obstructs or hinders any such inspector or other customs officer in the performance of his duties, shall be liable to a penalty of not more than $500.