Previously kobj_class_compile() would panic if its internal allocation
failed. kobj_class_compile() may be called from kobj_create() via
kobj_init(), and kobj_create() allows the caller to specify the wait
flags, so kobj_create(M_WAITOK) may trigger a panic due to an allocation
failure, which is silly.
Take a step towards fixing this: plumb the wait flags from kobj_create()
to kobj_class_compile(). I verified that all external callers of
kobj_class_compile() use it in a sleepable context.
There is still a problem: kobj_init() does not provide a return value,
yet may fail due to the allocation failure. Moreover, it is sometimes
called in a non-sleepable context (e.g., device probe). I considered
adding an mflags parameter there, but wanted to get some feedback
on this incremental step first.