Avoid multiply defined labels using tikzscale and TikZ externalize

I'm using the tikzscale package to scale my TikZ and PGFPlots graphics. This packages uses several iterations to get the desired dimensions. If I'm activating the externalization and use a label to be able to reference a plot, this results in a warning of multiply-defined labels.

How can I get rid of those warnings?

Use the following minimal not working example

\documentclass{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{tikzscale}
\usepackage{pgfplots}
\usepgfplotslibrary{external}

\tikzexternalize%

\newcommand{\plotref}[1]{\tikzexternaldisable\ref{#1}\tikzexternalenable}

\begin{document}

\begin{figure}[tbp]
\centering
\includegraphics[width=0.5\linewidth]{mnwe.tikz}
\caption{Test figure with reference~(\protect\plotref{leg:test}).}
\label{fig:test}
\end{figure}

\end{document}


and the figure file mnwe.tikz

\begin{tikzpicture}
\begin{axis}

• You could ask the tikzscale author regarding the multiplied labels. But looking at the output there is a more serious problem with the externalization: The page number is not expanded in the label and so you won't be able to use \pageref. This is imho a bug. – Ulrike Fischer Nov 10 '15 at 10:57