How do I backup a WSL instance to a `*.vhdx` file?

How do I fix «The process cannot access the file because it is being used by another process» / «Wsl/Service/0x80070020» on wsl --export --vhd?