Limits can be safely obtained with lim_cur from the thread. racct is compiled in but disabled by default. Note that racct enablement is a boot-only tunable.
This eliminates second most common place of taking the lock while pkg building.
Don't take the lock in mlockall either. This can be a separate commit.
There is one remaining lim_cur_proc place, but unfortunately it is being called from aio with the proc pointer. Can be fixed after 12 splits from head.