Fix transfer-state-changed event

Fixed transfer-state-changed to make it transition (only once
in the case of the initial and final states) through the following
states:

- started
- in-progress (n-times)
- completed

Plus added a small test case.