The block tree db is used within BlockManager to write and read the block index, so make the it a member variable of BlockManager instead of a global.
This is a backport of core#22371 [1/2]
https://github.com/bitcoin/bitcoin/pull/22371/commits/fa27f03b4943540aa2eab283d4cf50ad4a1a01f8