Make test/testknc.c build
Adopt some of nico's suggestions vis a vis error handling.