MB-12451 mcd leak when socket closes during read

Move the code which requires engine release to be
before the place we tear down the engine reference.

Change-Id: I14a9312ab6673f6f44e2f3561519090ba8708276
Reviewed-on: http://review.couchbase.org/42525
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Patrick Varley <patrick@couchbase.com>