Fix #205: Exception during Metamorph build

The refactored Metamorph builder failed to build scripts with collectors
which use `flushWith` and `<postprocess>`. Such scripts could no longer
be built but the builder aborted with an exception. The exception was
caused be the builder attempting to register the `flushWith` with the
end of the last function in the `<postprocess>` element instead of with
the collector.