MB-100: cleanup code to remove some compiler warnings

Fix the shadow parameter (-Wshadow), init order (-Wreorder), and
unused parameters (-Wunused) warnings.

Change-Id: I980361ade1ad182bce9536343d81a3216cbeb547
Reviewed-on: http://review.couchbase.org/26254
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>