Bug Fixes in KDE Base
don't crash when the list is empty
the do/while construct would die on an empty list. in theory this
shouldn't happen because we are asking with a Task pointer which
should only exist if there are, well, windows. however, due to the
async nature of windowing systems, during the time of the call all
of this can change.