[FELIX-4336] Use smarter thread locals for ThreadIo so that streams that have been deactivated won't be used and delegate to the previous stream instead