scripts: improve strip-whitespace.py

previous version barfed when it was called on a directory
(which could happen for example when called with a wildcard).
Also, add comment.