Add err checks in reply callbacks for tests.
Add failing close tests.

Callbacks are not properly cleared because of a typo, causing old
callbacks to be called a second time.
Properly clear callbacks.