Fixed bug that would prevent connecting worlds

If you had one or more local worlds, and the game connected a local world
as the fourth world, the thread would enter an infinite loop while holding
the queue lock and prevent worlds from being added.