Fix schema concurrency exceptions (backport of #6841)