Wait for pipe to be open before opening IPC pipe

Once I start using DB::sub and calling flush_events from
it, there will be a few calls to flush_events from both
the parent and the child processes before the pipe is set up (in between
loading and import time).  If we don't check for the uninitialized pipe,
the FILE that wraps the child's reader ends up pointing to standard
input =(
Don't trigger debug events on flush_events
Use DB::sub to prevent function call subexprs from messing us up

If you have something like the following:

    return -T $resource->name();

The lines in Resource::name will overwrite our previous trace after
the line in question's trace is written, making it look like
Resource::name generated an open event