src: call uv_loop_delete() on exit in debug mode

Should make tracing with valgrind a little easier on the eye and
possibly help expose libuv handle lifecycle issues.