Fixing exception tests, where the messages differ on windows and linux
Making the tests more reliable on windows, which has trouble deleting files