Fix memory management error found by lgtm.
The thumbnail cache would create QFile objects without deleting them later...