Merge r1886029 from trunk: * r1886029 Fix several crashes and JNI warnings in javahl TunnelAgent. Justification: JavaHL shouldn't crash. Votes: +1: jcorvel, amiloslavskiy