Added test + fix for callbacks for destroy.

Change-Id: If25863ddeaf2a3a8744d19dcc13dddbe62b45e0b
Reviewed-on: http://review.couchbase.org/41660
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>