Show number of forward transitions per aggregate and row in explain verbose analyze.
Merge commit 'eafa723' into invtrans
Try to improve on patch to add the average transitions per row to explain output

This moves the original code out into a helper function to match what the other code
does. I've also added a check so that the transitions per row does not show if there
are no aggregate functions in the window clause.