refactor: replace RecursiveMutex m_cs_callbacks_pending with Mutex (and rename)
Summary:
scripted-diff: rename m_cs_callbacks_pending -> m_callbacks_mutex
refactor: replace RecursiveMutex m_callbacks_mutex with Mutex
In each of the critical sections, only the the guarded variables are
accessed, without any chance that within one section another one is
called. Hence, we can use an ordinary Mutex instead of RecursiveMutex.
This is a backport of core#24069
Test Plan:
with clang and debug
ninja && ninja check check-functional
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D14731