set_next_input: squash multiple calls from the same cell execution

* When calling multiple times set_next_input in a single cell execution,
  we only keep the last input.

* Added generic support to PayloadManager for updating (instead of
  appending) payloads from a given 'source'.

Closes #1349