join: Don't add delimiter if only null-values are left

Looks like a nested loop that introduces polinomial complexity,
but the inner loop advances the outer loop as well.

Fixes Redmine #6552
classic protocol could not handle shortcuts. Is necessary for bootstrap
applied suggestion from @ediosyncratic
as requested by @jimis removed the -1 from ShortcutsExpand(filename, sizeof(filename) - 1,
Use conn->hostname and added Changelog as requested/suggested by @jimis