Fix alter_unreg() so that it follows the proper locking model. Before it came in locked and left unlocked. This now follows the proper model.