Apns fail count bug can slow shutdown.

* Fixed issue where last notification batch could be marked as failed from hours ago.
   - Now only checks for errors up to 30 sec after the last write.
* Fixed issue were it was taking up to 5 sec to shutdown each apns connection
   - Now checking if error handler is sleeping and killing the thread.