Add compile_block call into try/catch clause

Handle via generic error handler (fixes #789)
Re-throw not handled c++ exceptions
Make error handling more robust

Return when error has been detected.
Merge pull request #791 from mgreter/fix/issue/789

Handle C++ exception within C-API