Make do_dup() static and move relevant macros to kern_descrip.c

No functional changes.