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