Refactor window blocking.

Simplifies the blocking logic and will be useful once I rejigger the
way streams are multiplexed.