Avoiding race conditions in pre_save