ao_wasapi0: Support device enumeration and selection

Adds the :list suboption to ao_wasapi0, which enumerates the audio endpoints
in the system.

Adds the :device=<n> suboption, which either takes an ID string (as output by
list) or a device number and uses the requested device instead of the system
default.
ao_wasapi0: Support shared mode, better format guessing method

Uses WASAPI in shared mode by default, add :exclusive flag to choose
exclusive mode (duh). WASAPI works somewhat different in shared mode:
the OS suggests the sample format to use, and the GetBuffer call is
done slightly differently.

The shared mode driver does not consume audio as fast as it notifies
the thread; we need to check how much we're allowed to write. Not doing
this correctly results in spamming the console with
AUDCLNT_E_BUFFER_TOO_LARGE errors.

When guessing formats for exclusive mode, try several sample size and
sample rate combinations instead of just falling back to s16le@44100hz.
If none of the rates are accepted, tries remixing >6 channels to 5.1
channels. Failing that, tries remixing to stereo. Failing everything,
including the CD Red Book format, what else is left to test?

Calculate buffer_block_size based on the configured channels and bytes
per sample; MSDN docs say nBlockAlign is not guaranteed to be set for
anything but integer PCM formats.
ao_wasapi0: Demote "negotiation failed" message to MSGL_V

Could spam the console with what may be harmless in some cases. We already
complain loudly if we're stuck checking this too many times.
DOCS/man/en/ao.rst: Document ao_wasapi0
ao_wasapi0: Don't fail init when listing devices
ao_wasapi0: Don't complain about failed init during AO probing

Only if the user specifically asked for ao_wasapi0.
ao_wasapi0: Use the mix format directly in try_mix_format
ao_wasapi0: Rename to ao_wasapi

Nobody knows what the 0 was for. There's no "WASAPI version 0". Just take
it out.
ao_wasapi: Refactor device listing/loading

Omit "{0.0.0.00000000}." on devices that start with that substring,
re-add when searching for devices by ID.

Log the device ID of the default device.

Log the friendly name of the used device.

Consistently refer to endpoints/devices as devices, as this is more
consistent with mpv terminology.
ao_wasapi: Annotate the default device when listing devices
ao_wasapi: Don't leak the default device's ID when listing devices

Also remove unused variable.
ao_wasapi: Fully convert to m_option API
ao_wasapi: Use OPT_STRING_VALIDATE for device suboption

Validates by trying to pick the device using the device enumerator and
aborting with out of range on failure.

Refactors find_and_load_device to not use the wasapi_state; it might be
called during validation. Adds missing CoInitialize/CoUninitialize calls.
Remove unused variables (the SAFE_RELEASE macros keep them referenced so
compiler warnings don't help finding them...).

Remove the IMMDeviceEnumerator from the wasapi_state, it's only needed
during initialization and initialization is now well factored enough to
get rid of it.

Try and connect to unplugged devices as well when using the device ID
string.
ao_wasapi: Change function macros to require semicolon after invocation

Add semicolons where they were missing.
ao_wasapi: Don't search for devices as part of validation

This could turn valid parameters into syntax errors by the mere presence
or abscence of a device (e.g. USB audio devices), so don't do that.

We do validate that, if the parameter is an integer, it is not negative.
We also respond to the "help" parameter, which does the same as the "list"
suboption but exits after listing.

Demote the validation logging to MSGL_DBG2.
ao_wasapi: Support loading devices by name

Do an strstr match against the device description and, if we have only
a single match, take it. This works as long as the devices in the system
don't change, but it's not supposed to be reliable; if one wants
reliability, one uses the device ID string.

Formatting.
ao_wasapi: Fix double free on uninit

Caused by incorrect conversion to the m_option API: since we don't allocate
the state ourselves, we also don't free it ourselves.
DOCS/man/en/ao.rst: Update wasapi:device=<id> documentation
ao_wasapi: Support S/PDIF passthrough

Entirely untested as this troper has no S/PDIF hardware.

Refuses trying any other format if we can't use passthrough, or we would
end up sending white noise at the user.
ao_wasapi: Also do passthrough for AF_FORMAT_MPEG2

That's the sample format ad_spdif uses when the source is MP3.