This will be needed for g++-12 (after libstdc++6 12-20220206).
Steps to reproduce:
0gdb --args ./src/bitcoind -sandbox=log-and-abort -regtest
1./src/bitcoin-cli -regtest -named createwallet wallet_name=a descriptors=false
2./src/bitcoin-cli -regtest stop
BT:
0Thread 1 "b-shutoff" received signal SIGSYS, Bad system call.
10x00007ffff79564f7 in unlinkat () from /lib/x86_64-linux-gnu/libc.so.6
2(gdb) bt
3[#0](/bitcoin-bitcoin/0/) 0x00007ffff79564f7 in unlinkat () from /lib/x86_64-linux-gnu/libc.so.6
4[#1](/bitcoin-bitcoin/1/) 0x00007ffff7cc7335 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
5[#2](/bitcoin-bitcoin/2/) 0x00007ffff7cc94e3 in std::filesystem::remove_all(std::filesystem::__cxx11::path const&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
6[#3](/bitcoin-bitcoin/3/) 0x00005555559d4918 in wallet::BerkeleyEnvironment::Flush (this=0x7fffc4005160, fShutdown=<optimized out>) at /usr/include/c++/12/bits/fs_path.h:595
7[#4](/bitcoin-bitcoin/4/) 0x000055555592c058 in wallet::StopWallets (context=...) at /usr/include/c++/12/bits/shared_ptr_base.h:1665
8[#5](/bitcoin-bitcoin/5/) 0x00005555556617ca in Shutdown (node=...) at ./src/init.cpp:293
9[#6](/bitcoin-bitcoin/6/) 0x000055555563ada6 in AppInit (argv=<optimized out>, argc=<optimized out>, node=...) at ./src/bitcoind.cpp:249
10[#7](/bitcoin-bitcoin/7/) main (argc=<optimized out>, argv=<optimized out>) at ./src/bitcoind.cpp:273