Fix race condition in which close() may deadlock

Change-Id: I422471ed47216dafd7f3114fc3d1ea7f47d281c3
2 files changed