Do not emit references in generated declaration files if the --noresolve flag was set

This fixes a crash in the compiler when generating declarations with /// reference and noResolve
That's not possible because the shouldEmitDeclarations = resolver/shouldEmitDeclarations() does this check and is not upto caller to decide if we can emit declaration or not.