Small refactor of AC3 encoder.

It can now be initialised many times (not that it's ever used that way). Also let FFmpeg allocates the required memory automatically rather than using a fixed size buffer
Make sure we only run one Bonjour registration at a time.

Seems Bonjour isn't re-entrant with some implementations. So surround it with a lock

Fixes #11446
Make sure we delete RAOP device in the thread that started it.

Fixes occasional crash at shutdown
Make sure we delete AirPlay device in the thread that started it.

Fixes occasional crash at shutdown
Remove empty and unused main.h
Fix display of screen presented before main menu

On mac, the screen letting you know to upgrade your database, or making you select a language do not appear when using OpenGL. So use Qt painter at first, followed by using the OpenGL painter for the main menu.
Various fixes to HLS encoder and mythtranscode.

HLS encoder and mythtranscode assumed they were always receiving 16 bits stereo, which is just not correct with current FFmpeg. Modify them so they can convert on the fly the audio data provided as required.
Simplify avformatwriter so it will detect which audio format to use for the encoder ; this should make it more robust should FFmpeg change its formats once again.
Various simplification: store AudioFormat into filewriterbase, instead of bits and sample size
Rename "samples" when "frames" were actually used.

Fixes #11497