Military court convicts U.S. sailor of attempted espionage