New spawn C interface for more integrated error reporting
Fix #2027