nUnconnectingHeaders, m_headers_sync_timeout, fPreferHeaders and m_recently_announced_headers are currently all CNodeState members even though they are only ever accessed from the message processing thread (therefore sufficiently guarded exclusively by g_msgproc_mutex). CNodeState exists purely to hold validation-specific state guarded by cs_main that is accessed by multiple threads.
This is a partial backport of core#26140
https://github.com/bitcoin/bitcoin/pull/26140/commits/4b84e502f5ba69d650191ce8f2e20b86c1d427ed
https://github.com/bitcoin/bitcoin/pull/26140/commits/4b84e502f5ba69d650191ce8f2e20b86c1d427ed
Depends on D15289