[COOK-3824] Fix list construction in main.cf.erb

The previous code would take any array item that is equal to the last
one as the last one and print a line break.  Fix that using join, which
is also much simpler.

Signed-off-by: Peter Eisentraut <peisentraut@meetme.com>