Consistent json error
This will take a few passes to do comprehensively, but trying to clean up error handling in the extension module. Right now failure points are allowed, which can lead to segfaults or surprising behaviour when debugging.

Trying to push closers towards the CPython error handling conventions:

https://docs.python.org/3/c-api/exceptions.html

So basically:

  - Explicitly check for NULL from most C API functions except integer returning functions (where they return -1 and set PyErr) AND
  - Don't set error messages from failing functions, as they should have already set it