Cleanup scripts/soundlog

The first two changes were taken from a [patch](http://sources.debian.net/src/tlf/1.1.5-1/debian/patches/soundlog.patch/) of the Debian package.
The other change removes two bashisms, so that it can also run under a different shell (which seems to be intended with /bin/sh).