codegen: fix bugs in restarg; works for small nargs

For larger nargs, we have to look elsewhere in the va_list structure.