widgets/desktops: implement reading of desktop names

This commit also includes various improvements in memory and error handling
when fetching desktop information.