fixes ZEN-15717

DO NOT MERGE
I don't believe it's strictly necessary, but I don't think it hurts anything, and it serves as a failsafe against hangs if getOutput is exited unexpectedly.