[fix] Correctly close substreams when ended on both sides.