Fix shebang lines for non-dx executables in Debian package.

This is done in essentially the same way as for tarball releases. To
support this the parts of package.sh that used to do this are factored
out into a separate script.