use a callback in uv_close to free the handle