uv_close asserts that a handle is not already closing. We can guard against this assertion failure by manually checking the handle's closing status ourselves.