Fixing issue #291 (WIP)

The logic you've removed here means that we no longer call the `sync.cleanupFn` on close.  That's a problem.