Fixed a couple of goroutine leaks.

Hi, we've been using this in [cbugg](/couchbaselabs/cbugg) and I found and fixed a couple goroutine leaks.