kern_sysctl: Make name2oid() non-destructive to the name
It is not the first time I see it panicking while trying to modify
const memory. Lets make it safer and easier to use. While there,
mark few functions using it also const.
MFC after: 10 days