Optionally close connections after a set number of send attempts

This is (I think) the last in a series of changes intended to work around an APNs design issue where we can't know if connections are still alive. The idea here is to (optionally) close connections after a user-configurable number of notifications have been sent.

While #116 closes connections that sit idle, connections may never become idle in applications that generate lots of push notifications. This change allows very active connections to shut down after a set number of send attempts, so even applications that never allow for idle connections will have a reliable way to cycle connections.