DF-5198 fix problem with handle closing and change signature of Async function to return int instead of void