Fix ignores sometimes not being applied correctly due to thread-related race conditions
Fix ignores sometimes not being applied correctly due to thread-related race conditions

`set_patterns` is called by `ListenerWorkerThread` and modifies variables used by the main wpull thread. This introduces several race conditions. For example, this means that `_compiled` may rarely get cleared during the iteration in `ignores`, and `patterns` might change during compilation.

For performance reasons, it's undesirable to use a lock on every call to `ignores`, especially as that method might get called many millions of times on large jobs. This implements an intermediate solution that avoids such locking. `_compiled` is only changed by the main thread, therefore the actual ignoring can't be affected by the updates. The updater thread might change `_primary` and `patterns` during or after the recompilation condition, however, such a change would always also require a recompilation anyway, and that is guaranteed to happen either during that `ignores` call or on the next one. The same applies if the change occurs after the recompilation. Although it doesn't completely prevent them, this mitigates possible race conditions.

ArchiveTeam/ArchiveBot,ArchiveTeam/ArchiveBot,ArchiveTeam/ArchiveBot,ArchiveTeam/ArchiveBot,ArchiveTeam/ArchiveBot