MediaLibrary: Fix setExternalLibvlcInstance

The previous code was fairly broken and wasn't allowing an existing
instance to be replaced. The stop/replace/start sequence was also
broken.
This tries to properly:
- Stop currently running background tasks that use libvlc
- Replace the instance when nothing is using it
- Restart what we stopped

It's worth noting that the fsFactories will be started when required and
don't need a manual restart.
We could do without forcing the parser & discoverer restart, but this
would cause any potentially running scan/discovery to be aborted and not
be restarted until the user explicitly asks for it

Fix #357
9 jobs for !435 with fix_set_vlc_instance in 5 minutes and 50 seconds (queued for 52 seconds)
merge request