Fix JavaClient does not terminate correctly, close #112.