Fix bug: Handle root shell stream-close interruptions without crashing.