Nothing contained within sections 803-21 to 803-23, shall be so construed as to apply to ships of war, or other vessels commanded by officers bearing the commissions of foreign states, and not subject to search by the law and usage of nations.