test: rpc_users: Add function for testing auth params.
test: rpc_users: Add function for testing auth params.

Summary:
Straightfoward refactoring of code.

This is a partial backport of Core [[https://github.com/bitcoin/bitcoin/pull/16334 | PR16334]]
Commit c73d871799982ca29c29cef90e1a78814cf34019

Depends on D7852

Test Plan: `ninja && ./test/functional/test_runner.py rpc_users`

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D7853

Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc