libkvm: Make return value of kvm_getfiles(3) consistent.
The return value was inconsistent if this function is called on
coredump and on live kernel:
- The leading filehead will trash return value if it is called on
live kernel.
- Live kernel returns an array of kinfo_file but coredump returns
an array of file.
It probably only worked when KERN_FILE sysctl returned an array
of files and when the filehead was just a file ptr; or it never
worked (it reversed nfiles' and filehead's kernel address when
reading from coredump).
We now let it return an array of kinfo_file without any weird
leading stuffs.
While I'm here clean it up a little bit (mainly use NULL instead
of 0).
This also paves the way to split filehead.