DebugToFile was crashing on extern stages
DebugToFile was crashing on extern stages

Fixes #344


Former-commit-id: eef48e5217cac710d0726b7dec7dd9f45b33957d
darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide