cache-test: fix some minor things pointed out by coverity