Fix memory-safety and correctness bugs surfaced by Coverity audit (part 5) (#22279)
* dictionary: retry view inserts after stale entry cleanup Coverity CID 414657 (REVERSE_INULL): a rejected item-acquire path in `dict_item_add_or_reset_value_and_acquire()` left `item` non-NULL, so the `do/while` loop exited instead of retrying after stale view-entry cleanup. Clear `item` before retrying and cover the stale-view replacement path in the existing dictionary unittest. * dictionary: release view item on stale replacement branch in unittest Release the acquired `view_item2` on the stale/deleted failure branch of the view-replacement regression test, matching the release on the success branch so the test does not leak an acquired reference. * ebpf.plugin: make module state accesses atomic Coverity CID 405093 (MISSING_LOCK): ebpf_module.enabled was sampled from stats and shutdown paths while module exit code updated the same plain enum under a different synchronization regime. Convert the live cross-thread reads and writes to atomic helpers so those state checks stay defined without changing the existing lock layout. * ebpf: start function threads outside cleanup lock Coverity CID 405089 (SLEEP): Function-triggered eBPF socket restarts held ebpf_exit_cleanup while nd_thread_create could wait and retry. Gate the new thread until state is published, so creation happens outside the cleanup mutex without racing shutdown. * systemd-journal: pass depth+1 to recursive directory scan nd_journal_directory_scan_recursively() used depth++ (post-increment) when recursing into subdirectories, which passes the caller's current depth to the recursive call and then increments the caller's local counter across sibling iterations. Effect: the 2nd, 3rd, ... sibling subdirectories of the same parent get inflated depths and prematurely hit VAR_LOG_JOURNAL_MAX_DEPTH, silently truncating legitimate scans. Use depth + 1 instead so every recursion starts exactly one level deeper than the current frame. * systemd-journal: log visited directory tracking failures When dictionary_set() returns NULL the recursive scan still closes the current directory and bails out, but an operator looking at truncated journal discovery had no way to know why. Log the failure before returning so the condition is diagnosable. --------- Co-authored-by: Costa Tsaousis <costa@netdata.cloud>