Fix possible race conditions in strmbase/quartz.