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.