Merge "Fix incorrect closing of fds."
am: b5d064f5c6

Change-Id: I53f4702cf869ded214bb5e96846c6391a3482d88