Avoid race conditions when automatically creating databases.