many: collect time each task runs and display with `snap change <id>`
This PR imports the changes from Maciej that measures how much time
each task taskes to run. This data is stored in the state and can
be displayed via `snap change <id>`. E.g.:
```
$ snap change 563
Status Spawn Ready Active Summary
Done today at 09:28 CET today at 09:29 CET 13ms Stop snap "test-snapd-tools" (6) services
Done today at 09:28 CET today at 09:29 CET 39ms Remove aliases for snap "test-snapd-tools"
Done today at 09:28 CET today at 09:29 CET 27ms Make snap "test-snapd-tools" (6) unavailable to the system
Done today at 09:28 CET today at 09:29 CET 10ms Remove security profiles of snap "test-snapd-tools"
```
This is a first (baby) step towards measuring where we spend time
in e.g. firstboot seeding and where we need to optimize.
Thanks to Maciej Borzecki and Zygmunt Krynicki which wrote most of
this code.
tests/main/xdg-open-compat: fix the test to do as advertised
The xdg-open-compat test has been broken since the core snap started shipping
xdg-open that actually talks to io.snaocraft.Launcher via `snapctl user-open`.
Because of this, the actual com.canonical.SafeLauncher interface was never
accessed, and the test ended up just redoing what xdg-open test does.
Attempt to fix the test by calling com.canonical.SafeLauncher diirectly via
dbus-send.
Also, snapd-xdg-open does not allow help: scheme, make sure that we account for
that in the test.
Signed-off-by: Maciej Borzecki <email address hidden>