Don't lose packets writen during upgrade after a re-open

After a close, reset the prevBufferLen along with the buffers,
so a drain event after upgrade won't remove any packets that have been
queued up during upgrading.
Merge pull request #8 from goinstant/jbowes/dont-lose-packets-on-close

Don't lose packets writen during upgrade after a re-open