dev/mem: use sx instead of rw lock
(cherry picked from commit ca554a7dea3f90f39fc2b7d25813d0be944e12e2)