Files show British premier warned about ‘reputational risk’ for Epstein-linked Mandelson appointment