kernel: grab kernel version without `file`

Not all `file` are able to get kernel version. Use some magic stolen
from `scripts/extract-ikconfig`.