py: detailed error reporting.

Have a string field too as the simplest way to tell what failed. Currently
only used for HY_E_IO error.

Related: RhBug:1117789