added better exception mesaging avoiding problems in case of traceback file descriptor already closed (only on windows)