Handing on SSL connection fix.

* Fixed issue where trying to open a SSL connection to APNs can hang.
   - It now times out after 20 sec and does retrying.
   - On shutdown any connections stuck in a retry loop they will be saved to the retry redis key before shutting down.