Fix windows cycling order in runOrRaise

Successive calls to runOrRaise could end up not visiting some of the
windows because of the way windows were being ennumerated (each time in
different order).

Sorting by window title is just a hack to work around the lack of
persistent window identifiers.

Sorting by pid() won't work since many different windows can share the
same pid.