Make sure we fully flush the channel when performing an upgrade, as SSL may need the flush call