Added support for a NULL realloc function to bson_writer

It is possible to specify a NULL realloc function when initialising a bson_writer. This commit prevents invocation of a NULL function pointer.

NULL realloc_function's are useful for writing into fixed size buffers.

Note: I had to modify bson_writer_begin to indicate success/failure via a return value.