Rafael Nadal beat Bjorn Borg's son Leo, who was playing in front of his home crowd, to reach the second round of the Swedish Open.