Handle quick shutdown with polling better.

Closes #749

Matthewrmshin - please review.