```
Currently the unloadwallet RPC is asynchronous, it only signals the
intent to unload the wallet and then returns the response to the client.
The actual unload can happen later and the client has no way to be
notified of that.
This PR makes the unloadwallet RPC synchronous, meaning that it blocks
until the wallet is fully unloaded.
```
This is expected to fix `wallet_multiwallet.py` failure with TSAN.
Backport of PR14941.
Depends on D5079.