CBQE-0: define variables in case exception occurs

Change-Id: I2cf194c32f6f5b3c1529b53f0fc42b2d7ff71bcc
Reviewed-on: http://review.couchbase.org/25313
Reviewed-by: Tommie McAfee <tommie@couchbase.com>
Tested-by: Tommie McAfee <tommie@couchbase.com>