[backport] Clean projects in a background job when project settings' change

Cleaning the projects in the UI Thread was causing UI freeze. The
fix is really simple: clean the projects in a background job.

Note: The implemented solution is inspired by the Eclipse
      ``CleanDialog`` component.

Fixes #1001527
(cherry picked from commit aec8edd4136ff82d9a81860b4f7002f5f4e4f6c4)