buffer: no warning when encoding isn't passed

Buffer#write() was showing the deprecation warning when only
buf.write('string') was passed. This is incorrect since the encoding is
always optional.

Argument order should follow:
  Buffer#write(string[, offset[, length]][, encoding])

(yeah, not confusing at all)
src: make buffer size errors more explicit

Fixes #6490
buffer: convert values to uint, not int

In many cases values expected to be unsigned were converted to a signed
integer.

Also include some small code cleanup.
src: make queue.h c++ compatible

This is a cherry-pick of commit joyent/libuv@0520464.
src: add ASSERT/CHECK/UNREACHABLE macros
src: add prof.on('gc') statistics hooks

Add a new 'prof' module that lets the user register listeners for gc
events.  The listeners are invoked after every garbage collection cycle
with 'before' and 'after' statistics.  Useful for monitoring tools that
want to keep track of memory usage.
prof: add getHeapStatistics() function

Add a one-to-one binding to v8::GetHeapStatistics().  Returns info on
the current state of the JS heap, like total size and amount used.