New fix for #11647 (closed). Avoid side effects like #17171 (closed). Backport of !1806 (closed) to %8.8.2.
If a main module doesn't contain a header, we omit the check whether the main module is exported. With this patch GHC, GHCi and runghc again use the same code to check whether the main module is exported.