Protect against errors removing temporary directory