C wrapper: return dynamically allocated PatcherErrors