[metastore] Ensure database exists before creating a table