Fix #5056

This modifies `ios_t` to store both readability and writeability of a stream. It therefore occupies another bit in the bitfield, but it shouldn't change the overall size of the struct.