Fix a possible race condition when audit logs are created very fast