On error, close the temporary file descriptor.

With this change llvm-ar can remove the temporary file on windows too.