3.6/f/unix stream spinning fix

This is a backport of a bugfix in HEAD against 3.6/master. It has already passed review, the only change is that it has been rebased against 3.6/master.

Please merge!