Merge "Fix incorrect closing of fds." am: b5d064f5c6 am: 927b30bb1d
am: ae46ca424d

Change-Id: I5a2599354f441e49ce6217a58bbf363733e541a0