Don't make unnecessary calls to LazyFqdn.__str__.

Before this patch we always tried to expand variables in the
config even if they weren't present. This meant that we made an
expensive call to LazyFqdn.__str__ the first iteration of the expand
loop, stealing precious cpu and user time.

We now check that the expansion actually exists in the config
before expanding it, this will speed up the case where %l is not
used.

This fixes #338
Changelog re #376, closes #376