make TestProcess.test_terminate more robust