Solved data races in pkg/registry

The old version has a data race detected by ``go test -race``.
It seems that we did not change any member's value in create/update, so I used R(un)lock(). Anyway, I changed to Mutex now.