Close file descriptor

Fix for leaking opened file descriptor