CBQE-1014 Fix typo and order of teardown call

Change-Id: If28235d1310ff3fa018c87e584690794b8d5658b
Reviewed-on: http://review.couchbase.org/24871
Reviewed-by: Farshid Ghods <farshid@couchbase.com>
Tested-by: buildbot <build@couchbase.com>