incompatibility fix with old basename

Prior to basename v8.20, the -s option didn't exist, and previous
versions used a syntax where the suffix followed the filename instead.
Since this is still supported even on new versions of basename, I
changed the script to allow older versions of basename to work (which
still ships even the latest debian 7.3 for instance).