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
Fix #357 (closed)