cbson: check various return values from python APIs.