[lock] bug fix: 1. lock release in insert(); 2. loop condition change in delete()