Mechanism of wrinkle formation in curing coatings