Check visual parent is not already set.
When setting the visual parent of a control, make sure that it's not
already set. The code in issue #513 was trying to reparent an already
parented control, causing problems - this makes sure that this can't
happen.