src: cast uv_thread_self() to unsigned long

The update to libuv 1.0.0rc-2 in #8566 introduced a compiler error, as the return type of `uv_thread_self()` changed in https://github.com/joyent/libuv/pull/1516. This commit restores the old behavior by casting the return type.