MB-11779: Switch the engine context before we update the task log

If we don't do this then we lose 48 bytes from the bucket mem_used
each time the executor thread runs.

Change-Id: Iecf216e3c262573a3b36911f80f44b92851d2a5f
Reviewed-on: http://review.couchbase.org/40201
Tested-by: Michael Wiederhold <mike@couchbase.com>
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>