change jlapi to Python-like style in which NULL is returned on exceptions, and a separate jl_exception_occurred function retrieves the exception