mainloop: re-factor CHECK_RC_RETURNING to use std::cerr