Fix frontend not connecting to the master backend on startup

On a combined BE/FE system, the frontend does not always register with
the backend, which can lead to the backend shutting down due to the idle timer.

The BackendConnectionManager? usually ensures a connection to the
backend by querying the 'Master host prefix'. On a combined BE/FE
this prefix can be retrieved directly without having to communicate
with the backend and no connection is made.

The fix adds a thread-safe alternative to ConnectToMasterServer() and
avoids BackendConnectionManager() from exploiting a side-effect of
GetMasterHostPrefix()

Fixes #11238

Signed-off-by: Stuart Morgan <smorgan@mythtv.org>