Fix a crash arising from a race. (Swift only.)