Fixed CI yaml files, race condition workaround.

Finally got Travis CI and AppVeyor YAML files setup with MySQL.

Travis CI sometimes ran into some weird IntegrityError exception for
SQLite and MySQL. Trying to work around this by giving the thread enough
time to setup.