Update C++ code to set status via the C api.

This prevents mismatches from breaking tests.
7 files changed