Make bin/deb2tcz.sh more robust

This fixes some variable name confusion in deb2tcz.sh and improves the handling
of more complicated packages (those with startup scripts).