Fix potential resource leak: stream not closed on exception