Moving drainBuffer() call to execute after socket is closed
Merge https://github.com/appglu/java-apns