Assert non-empty control flow nodes

The scheduler asserts that control flows are non-empty, i.e. that they have children. We should implement the same check in CompositeNode (the Python representation) to avoid the need for a dbg build to trigger the assertion.