qt: Hide peer detail view if multiple are selected
Summary:
Currently if multiple peers are selected the peer detail view shows the first new selected peer.
With this PR the peer detail view is hidden when multiple peers are selected. It is also a slight refactor to simplify and remove duplicate code.
This is a backport of core-gui#13
Test Plan:
ninja all check-all
Run bitcoin-qt, open menu Window > Peer. Select multiple peers.
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D10814