allow more operations to work on detached streams (closes #23093)

Patch by Martin Panter.

--HG--
branch : 2.7
extra : source : f3ff3e424b6f893a0f3c81f7bbdbc3d7ae018d10