The loophole is that there was no declared war.
There is still a possibility that Kerry commited some form of espionage during the period immediately after he returned from Nam, where he had a stateside military job that I recall had access to an awful lot of information (like personnel and activity records, perhaps).
Even during peace time a military soldier, including active or non-active reserve, can't protest against the government. In the oath one must protect and serve under the authority of the government. Treason maybe not but there must be some UCMJ Law for this. Maybe Unbecoming of an Officer.