Handle register R/W events inside the memory lock.

This is necessary since a read/write might trigger
further reads/writes.
Mostly handle DEBUGCMD and RESETCORE.