pre-commit-no-snapshots.sh: improve SNAPSHOT check

The check now examines only the staged diff rather than the entire
working copy. So if you add a SNAPSHOT reference locally for development
purposes, but are not actually committing it, the commit will not fail.

Thanks to Barry DeZonia for the suggestion.