veyron/runtimes/google/lib/follow, veyron/services/store/memstore: Miscellaneous fixes in follow and watch.

Specifics:

(follow)
 - release resources if NewReader() fails.
 - take filename, not file, as the argument to NewReader(). This allows
   the proper release of resources, and matches reader.Close(), which
   closes the file.
 - make reader.Close() idempotent.
 - kill unsafeClose(), and lock around file.Read(). This narrows the
   window of pre-emption of reader.Read(), but I'd rather not trade
   correctness for performance.
 - do not attempt to drain the events queue in reader.receiveEvents(),
   instead, do not send duplicate events in sendEvent().

(log)
 - make RLog.Close() idempotent.

(watch)
 - check for cancellation before processing logs.
 - consolidate cancellation events and send them on the cancel channel.
 - set the Continued bit in processChanges, instead of in the processor.
 - refactor tests to use a fake WatcherWatchStream.

Change-Id: I88d564169e0f87b20321d2c2b7f9f94cf3a7ed58
19 files changed
tree: 560879aeafa7d585776cafedeb7614dff591e382
  1. examples/
  2. lib/
  3. runtimes/
  4. security/
  5. services/
  6. tools/