Fix an issue with deferred memory reclamation

Thread pool workers would only poll for reclamation while busy.
If a thread falls idle before an epoch ends, then its memory
won't get reclaimed until that thread wakes up to process work
later on.

This diff introduces a maximum wait of 5000 milliseconds (configurable)
for worker threads; if the worker idles for this period, we'll wake
up and poll for memory to reclaim.