tail: fix unclosed file descriptor
test: adjust for windows