bson: check for trailing NULL byte immediately upon creating document.

Our bson_iter_t will catch this problem, but since it is a constant
time operation it seems useful enough to do upfront.