Bounce JavaAction code on a trampoline

By avoiding context switches we improve performance for Java actions.

I didn't include a test for this code because there is already one, in integrationtest-java's SimpleTest.