use scoped_wlock and scoped_rlock for rw_mutex

fix #769 
we should use `scped_wlock` and `scoped_rlock` instead of scoped_lock for `rw_mutex`.