Use scoped lock inside mac-specific XrdSysSemaphore implementation to avoid deadlock on thread cancellation