Merge "Fix incorrect closing of fds."