Fix write/close deadlock
Fix write/close deadlock

When the monitor goroutine sees that the connection has closed, it is
sometimes possible for resetChan to be full and a Write() invocation
blocked sending to resetChan. If this happens, and monitor attempts to
grab the write lock, it will result in a deadlock because Write() has
the lock, monitor is trying to acquire the lock, and nothing is draining
resetChan.

Start a goroutine in monitor to drain resetChan, just before trying to
acquire the lock.

Fixes #49

Signed-off-by: Andy Goldstein <6fe6b8a05df7f9c8cc3eafd421a9b8433d86fa1d@redhat.com>

ncdc/spdystream,liggitt/spdystream,jbenet/spdystream