Clean up appsync list and dbus correctly

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
Actually report an error if something goes wrong with the appsync,
and at the same time allow for more than program to be launched.
Check for the appsync errors in the mode setting too.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
Clean up the devicelock DBUS

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
Clean-up dynamic config list

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
Avoid leaking memory when something goes wrong launching
services over systemd dbus.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
Clean up dbus, lists etc and exit cleanly when interrupted.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
Clean up mode tracking to avoid a small memory leak.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
Improve dbus clean-up.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
Handle mode change failures more reliably.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>