Correct a bug where an invalidated reference was used after growing a std::vector.
Handle __error() for errno on OS X.
Correct the size of the memmove recorded for realloc() calls.