Improve modification notifier locking

The existing code use a single lock for all queues, instead of a lock per-queue.

The timeout update can be implemented with atomic operations, which would reduce contention quite a bit.

Ideally this needs to be profiled beforehand though