Fix for rpush not shutting down + debugging.

* Added ThreadHelper to handle joins with timeouts.
* Added lots of debugging around shutting down.