blocks: refactored stream_mux to be more flexible with buffer sizes

Fixes a rare and minor bug.