HRCPP-87 JniTest exceptions in c++ code crash the jvm

https://issues.jboss.org/browse/HRCPP-87