Ensure that updated command ID is sent to the datanode once its updated in the
active snapshot on the coordinator/datanode

We have an optimization to discourage sending command ID unless its needed.
That works by tracking top level statements, but that not work when multiple
statements are executed as part of a single query. This can happen in
multi-portals or with plpgsql functions. So now we signal the coordinator (or
datanode in case of datanode-datanode communication) to send down updated
command ID when its updated in the active snapshot. More testing required to
ensure that there are no other paths which may require similar treatment.

Bug report and test case from Aaron Jackson. Fix by me.