Fixes #4611,#7353 - control the db_pending_migration/db_pending_seed from installer

This allows tracking the state of migration/seeding in the installer and
making sure the rake tasks are done on subsequential when something goes wrong
the first time.

Also, as part of the `foreman-rake config` calls, we ensure that the settings
are initiated before the httpd starts (preventing the race-conditions
happening when the httpd and rake db:seed start at the same time)
That's not the case. It works like this:
Given the the database in not yet migrated: the unless part of the `foreman-rake config` will fail, because the missing settings table. But here, it's quite expected: but it's important to run something successfully, because the `rake db:migrate` is subscribed to this event: this allows us to make sure that we really complete the rake tasks when needed (as opposed to not doing so when something else fails in the first installer run).