There is no need to compile our DLLs as shared libraries since we are
managing symbols exports and imports through spec files.
On my system, this reduces the configure-time by a factor of two.
- Use a new work_available event to allow ProcessPlayingNotes to sleep when no
notes are to be played.
- Get rid of the pointless thread_termination_complete event, wait on the
thread handle instead.
- Don't leak thread_handle.