unix, windows: move uv_loop_close out of assert

Closes #1387