Fix MACHINE determination in the setup scripts

Also don't emit ugly errors from tac if the builddir setup failed.
JIRA: SB-2878