Modify "util_datadir" unit test to not use gArgs.
Summary:
This is a backport of core#21244 [3/8]
https://github.com/bitcoin/bitcoin/pull/21244/commits/1cb52ba0656e78ca6c2ef84b1558198ad113b76a
Depends on D10750
Test Plan: ninja check
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D10751