Make sure every window object is closed only once in bulk close

When all windows are closed in one go, it could happen that close() is
executed twice on a window object. That is because all windows to close
are fetched into an array and closed one after each other, but closing
one window can implicitly cause the closing of others (e.g. when a
project is destroyed). This causes some problem with the listeners of
each window's CLOSE event. Therefore, this commit introduces a small
fix to make sure each window is only closed once. This is done by
retrieving the list of open windows after closing instead of walking an
up-front created list.

This fixes issue #635 which prevented the display of CATMAID's
front-page when the "Home" link was clicked and at least one non-stack
widget was opened.