Clean up file descriptor after use