tests: add code to detect kernel version

that way we can say a test fails due to kernel being too old,
rather than a straight out FAIL