MediaLibrary: Don't recreate database while background jobs are active

Fix #405
9 jobs for !594 with fix_table_recreation in 5 minutes and 10 seconds (queued for 2 seconds)
latest merge request