Fix a couple of timing issues in tests related to mariadb