Getting things working with -Wall and -Werror

o adding some function declarations
o getting rid of some unused variables
o bson_return_val_if_fail instead of bson_return_if_fail for non-void
  functions