Script to clone domain wasn't waiting for db

In certain circumstances, the database was not ready when the clone
domain was requested. To combat this we now:

* Run a postgres test for the time to ensure connections are allowed
* Tie this into a wait_for with a nominal 300s timeout
Merge pull request #1154 from psav/fix_db_wait

Script to clone domain wasn't waiting for db