Add option --max-for-expensive to limit resource usage.

If --max-for-expensive=NUM is passed together with --dfs or --bfs, the
stack/queue size statistics per visited node are omitted. Instead we just
return the maximum of the queue/stack size.

This is done in order to limit resource usage in handling the yaml data in
the output.