setup-environment: Add shared download and sstate mirror folders
The current script didn't setup the shared download dir /usr/src/packages and not the sstate cache. Now this is done, but only if they exist, otherwise the local folders are used.
Also sets up machine, distro and builddir to usefull defaults when called without parameters.
Some shellcheck specific cleanup
BCS 746-000074