bson: don't use variable before it is set.

We should enable -Wuninitialized.
build: add -Wuninitialized and -Wunused-but-set-parameter.