java: when rethrowing exceptions, store the original cause

so that we get a nice complete stacktrace when it hits the final
handler

Change-Id: Iec4fcc15a2a25c55f591b5e069dce3d010197a90