Fix empty hostname bug

The read statement will evaulate the lines[n++] expression for
each line in the input wordlist that does not start with #. It
will however also evaluate the expression when it reads an EOF
from the stream. This means that n will equal the number of
entries in lines plus one, which in turn means that when rand
returns n-1 in r, the resulting line will be empty.

Signed-off-by: Jonas Eriksson <zqad@acc.umu.se>
Avoid the same hostname in one session

By adding a # in front of used words, genhost will not display
the same word in two subsequent runs. It is however possible to
display the same word within one run. When generating a large
number of hosts, it might be hard to notice the duplication.
This commit solves this issue by filtering the wordlist in each
iteration. The code for this is not very beautiful, since bash
arrays are essentially associative arrays.

Signed-off-by: Jonas Eriksson <zqad@acc.umu.se>