Update Container.cpp

Fix for addControl().

Rearranged execution.
Adds ref before removing control from current parent, avoiding deletion of control.
Merge pull request #1443 from KJO/master

Fix for addControl prematurely deleting control.