Fix a race condition in file watcher.

It was possible for events to be added to the events controller after it
had been closed if the call to close() came in while a method was
waiting on an asynchronous callback.

R=cbracken@google.com

Review URL: https://codereview.chromium.org//1228703007 .
5 files changed
tree: 0ecf92a8ffc1e6e49840fb84d14ac096129c5574
  1. pkgs/