Deactivate the handle before sending the async close callback.
We could have a race between handle closing and processing async callback. Deactivate the handle before issuing the callback - we have the socket referenced anyway so it's not a problem.
Closes #1700
Edited by Witold Krecicki