MediaLibrary: Delete and recreate all tables in the same transaction

Fix #399
8 jobs for !565 with recreate_database_in_transaction in 8 minutes and 18 seconds (queued for 22 seconds)
latest merge request