Added locks on setpwalletRegistered functions.