Fix handling of the io flags in duplex mode.