improved version: fixes a few thread safety issues (deadlocking when
pausing / stopping), also has faster resuming (shorter sleep cycles when
paused), logging can be disabled and there is a method to obtain the
current thread running the player (useful for .join() ).