Adaptation to heavy-metal contaminated environments proceeds via selection on pre-existing genetic variation