Enhancements in connection handling for APNS

This relates to #85
Added keep alive option to the socket, now poll the socket for write
mode before sending, and also splits up the message writes into two
calls for each notification to try and cause a closed stream to throw an
exception