[dune-autogen] Prevents overriding am_dir with installed modules.

Before this patch we tried setting am_dir for directory with a
DUNE module. If one is working with local modules
(e.g. dune-common and dune-geometry), that are a subset of installed
modules (e.g. dune-common, dune-geometry, and dune-istl), that are all
installed under the same prefix, then modules that are part of the difference
of the set of installed and the set of the local modules caused am_dir to
point to the am directory of the installed dune-common directory.
After this patch  am_dir is only set once, which fixes this behaviour and
flyspray issue #1420