Backport PR #4264: catch unicode error listing profiles

there can be garbage files on the filesystem, and we shouldn't be bothered by them.

Candidate for backport