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
Fix style
payload.write_payload: use `single` keyword instead of `update`

* change default behavior when adding payloads to single=True
* document write_payload
PayloadManager: Fix docstring.
Add regression test for #1349
Merge pull request #4363 from pablooliveira/set_next_input-reuses-cell

set_next_input: keep only last input when repeatedly called in a single cell

change applied in general to payloads