use scoped_r/wlock instead of scoped_lock for rw_mutex fix #769