Fix possible exception while moving layout children

Signed-off-by: Daniele Ricci <daniele.athome@gmail.com>