Prevent race conditions between style generation and directory cleaning.