Improve GNOME applications statistics

- log apps start and end
- skip logging window changes within the same app
- a for was in need of a break