Added resend functionality to RsgJNI. Bugfix for crash on exit.