Steps to reproduce:

```
$ ./src/bitcoin-wallet -datadir=/tmp  info  -wallet=asdf
Wallet info
===========
Name: 
Format: bdb
Descriptors: no
Encrypted: no
HD (hd seed available): yes
Keypool Size: 2000
Transactions: 0
Address Book: 0
```

(See the mismatching wallet name!)

Compare to:

```
$ ./src/bitcoin-wallet -datadir=/tmp  -wallet=asdf info
Wallet info
===========
Name: asdf
Format: bdb
Descriptors: no
Encrypted: no
HD (hd seed available): yes
Keypool Size: 2000
Transactions: 0
Address Book: 0

{
    util::ThreadRename(name);
    try
    {
        LogPrintf("%s thread start\n", name);
        func();
        LogPrintf("%s thread exit\n", name);
    }
    catch (const std::exception& e) {
        PrintExceptionContinue(&e, name);
        throw;
    }
    catch (...) {
        PrintExceptionContinue(nullptr, name);
        throw;
    }
}
std::string CopyrightHolders(const std::string& strPrefix);
/**
 * On platforms that support it, tell the kernel the calling thread is
 * CPU-intensive and non-interactive. See SCHED_BATCH in sched(7) for details.
 *
 */
void ScheduleBatchPriority();
namespace util {
template <typename Tdst, typename Tsrc>
inline void insert(Tdst& dst, const Tsrc& src) {