Avoid second lookup in lock table

Use insert when creating a new (addr, lock) pair, so that we can get 
an iterator to the position. Then use the iterator to get the mutex.

Remove repeated calls to operator[]