[SUREFIRE-946] add shutdown hook in main process to make sure the TestProvidingInputStream is closed and all locks held by it are released