Fixes for selector shutdown logic.

Without this logic the ENXIO selectors went back into the pool,
carrying along their still-ready pipes. As a result, subsequent
uses of those selectors returned immediately, and select would
fail to produce results forever.
Fix up botched selector handling of pending reads.