tests: cpp: fixed set_ioflags() calls
tests: cpp: removed dududuplication in throw