MB-8149 Possibly dangling pointer

Change-Id: Ia39f2148922fcd762a7e2a4bf69ebcbf85cc14c8
Reviewed-on: http://review.couchbase.org/28388
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>