Templatized syscall structures

I don't think this addresses everything (it occurred to me that places doing things with `syscall_defs.h` probably need to be revised, etc.), but I'd like to get this into the tree.

This patch is essentially the same patch as was last posted in #1195, but rebased to pick up the `struct mmsghdr` changes that went in recently.
I think we should assert here that the value actually fits. But that can be a separate patch.