Assertions were wiping out tracking of heap allocations

Halide pipelines may have been leaking memory as a result.
Added ability to dump intermediate pipeline stages for debugging

Call Func::debug_to_file. Only works on Funcs that aren't inline.
Merge branch 'master' into nick-sandbox