Reset shutdownPending only when necessary
Reset shutdownPending only when necessary

If all notifications are transmitted and shutdown completes then it
would reset the shutdown pending flag. If a notification then errors it
would trigger the connections to be restarted but they would never
shutdown.

Fixes #299

node-apn/node-apn,guoyu07/node-apn,argon/node-apn,F4-Group/node-apn