Fix issues pointed out by clang-analyzer

Previously joyent/libuv#1502.

cc @saghul