medialib: improve starting
Some controls request to "start" the medialibrary (start to discover
some folders) if not already started. The actual starting should be done
at most once.
The fact that it was already started relied on the number of entry
points, which can only be known by executing SQL queries. For
asynchronous controls, this caused the execution of SQL queries on the
UI thread for every control requesting the medialibrary to be "started".
To avoid this unnecessary performance issue, add a simple atomic flag.
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>