Port mch_isdir to libuv.