We don't use all three out-pointers for every value, and set is usually
optional entirely. Only clear the ones that are actually set, and add
assertions for the which-levels that need them to allow callers to avoid
needing throwaway thread/proc pointers on the stack if they only want to
resolve a setid to a set.
This should fix a path in intr_getaffinity() that would seem to deref
NULL unconditionally, if it were actually hit.