Adds an RPC to get and set currently active logging categories.
Backport of Core PR10150
https://github.com/bitcoin/bitcoin/pull/10150
Also pulled the `EnableOrDisableLogCategories()` function and the updated libevent filter code and `Logger::GetCategoryMask()` function from Core PR12954
https://github.com/bitcoin/bitcoin/pull/12954