[cmake,release] Prevent searching twice for modules.

Before we tried to search for dune-common twice (once without a version
and then with the required version). Unfortunately this breaks because
we are adding the same library target twice. With this patch we only
search for a module once.