make bson_realloc really free memory

At least on OS X, calling realloc(mem, 0) does not completely free the underlying memory and this results in a memory leak.

This patch fixes the problem.