Fix initial incorrect value for Switch

Task-number: QTBUG-36910

We would sometimes get the incorrect value for switch.
This patch doesn't radically change the logic but it makes the
initial value assignment a binding rather than depend on
oncompleted. I also slightly cleaned up and simplified the
logic.

Change-Id: I001494a5f9f3a421a5c755a7fed1f9be09d918bd
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>