MB-9510: Less warnings

Only function-unused warnings are left. All other warnings
by GCC and Clang are fixed.

Some warning only showed up in GCC when compiled with -std=c89.

Change-Id: I495d4ce951c3d705936afefa846511dbd5410e40
Reviewed-on: http://review.couchbase.org/30319
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: buildbot <build@couchbase.com>