Make it possible to profile queries with multiple NullPipes.

... queries such as those containing UNION, MERGE and OPTIONAL MATCH parts.