fix bugs in install_xtuple.sh

This fixes some basic bugs in install_xtuple.sh

The most important thing is that it will not keep executing any more commands after something fails.

It also makes it possible to run on other distributions such as wheezy instead of precise.