Feature/issue 138 mode change cancel pendings

* When mode changes, all notified (i.e. pending) are cancelled, as well as any currently collecting location points.
* All the network operations that have a local effect when finishing (crypto registration, parameters update, profile PUT) also check if the mode has changed between their starting and their finishing, and abort if so. (Polls and LocationPoints POSTed to server don't change their behaviour, since if the mode changes, their local effect after completion of the network request is neutral)

This fixes #138.