src: make queue.h c++ compatible

This is a cherry-pick of commit joyent/libuv@0520464.
src: add ASSERT/CHECK/UNREACHABLE macros