serprog: flush stream in sp_docommand

This is to prevent bugs in the future - currently sp_docommand
is not called with operations in flight, but this makes it safe.

Signed-off-by: Urja Rannikko <urjaman@gmail.com>
serprog: optimize serial buffer handling

Now we remember the size of each sent command, and
allow us to continue when enough ACKs have been received,
instead of all the ACKs.

Signed-off-by: Urja Rannikko <urjaman@gmail.com>