Recode the resource limit core (struct plimit) to fix a few races and