Fix NPE when unsubscribing.
Clear buffer and callbacks when calling #close.