Lock stats modifying in a mutex