[userprog] fine-grain cleanup locks