Improved handling of clicking ctrl + C when running tests