changes some of the test commands to use bash functions
includes some small bug fixes to tests where bugs were
previously not seen due to different plumbing.
If gethostname() returned "", we used "localhost" as mock-up hostname.
However, this caused problems depending on how the local system name was
actually configured.
We have changed the mock-up hostname to "localhost-empty-hostname" now
to clearly indicate the problem. Also, we make sure that we do no
accidently try to resolve the mock-up hostname.
closes https://github.com/rsyslog/rsyslog/issues/1268