Allow db.c to exit gracefully on receiving a signal

Some profilers (such as google profiler) won't generate a report if the
application was terminated abnormally

Change-Id: I3cd67363100859dabe17506fa1d8bb41b96a5c53
Reviewed-on: http://review.couchbase.org/26912
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>