Use SafeSemaphore instead of (deprecated) QSem