Fix race condition for many requests with newvalue

If multiple requests all had a newvalue: in them, and they came in one
after the other via ajax, then we would write the same value many time
and this would cause a significant problem!