Allow aborting the pack writing operation

In case of an error in the writer, the packbuilder will stay around
waiting for someone to read from its channel. The state associated
with a packbuilder is non-trivial and it will keep a reference to the
object, so the GC won't be able to free it.

Change the callback so it knows to abort the writing operation when it
receives a message through the channel and the goroutine can end,
freeing its hold on the packbuilder.