tests: fix and add lint for non-portable head -c N