Handles for things like timers should be unique on a per-thread basis in
the Win32 API, but apparently window classes have to be unique for the
entire application.
This allows for a significant speedup in plugin scanning time for plugin
groups, since starting Wine processes takes up pretty much the entirety
of the time spent scanning plugins.
This was not a problem with individually hosted plugins because the
entire process got terminated at once, but here we all threads to shut
down gracefully when a plugin's sockets get closed. I wish this wouldn't
need all these try-catches, but we're not writing Haskell here.
The only issue remaining is that for some reason only the first
instance's editor works, at least for Serum. This might be because of
the message loop.
To prevent a race condition when an exiting plugin wants to terminate
the process when it think there are no plugins left just as another
yabridge instance is connecting to the group socket.