Fix leak when freeing compiler stream