Stats unistd fix and tests enable

Fixes:
Typo in usage message for stats
STDIN_FILENO
missing include of unistd.h for isatty()
Adds:
Testcases to test.pl