callbacks.c: remove boilerplate

This commit reduces the file size from 600 to 100 lines. This is in
preparation for a larger refactor of the callback API in general.

Change-Id: I382008869ca0ab8ba9433833588bd66e4cf97e5d
Reviewed-on: http://review.couchbase.org/38160
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>