move __save_flags from <random> to <ios> in preparation for reuse; no functionality change