This is a pure refactoring of zmqnotificationinterface to make the
code easier to read and maintain. It replaces explicit iterators
with C++11 for-each loops where appropriate and uses std::unique_ptr
to make memory ownership more explicit.
This is a backport of core#13686 [1/5]
https://github.com/bitcoin/bitcoin/pull/13686/commits/e15b1cfc310df739b92bd281112dbeb31d3bb30a