Now tries to stop Java threads when the associated Erlang process terminates.