Fixed a race-condition bug observed when closing multiple windows

Change-Id: I94c25aa173dddbc7a2d458d9f801463ac88e79cd