util, refactor: Use GetPathArg to read "-rpccookiefile" value
Summary:
This is a partial backport of core#24675
https://github.com/bitcoin/bitcoin/pull/24675/commits/138c668e2b4d64279ddefbe07c1d9b7c3d3c537c
Depends on D16199
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D16200