[applets/taskmanager] Fix "virtualDesktops is undefined" error
It looks like virtualDesktops may be undefined under some circumstances if only 1 desktop is used. Explicitly check that it's not undefined, and process virtual desktops information only when it's used.