Fixed state check to support older and newer versions of ember.

Signed-off-by: Alessandro D'Aquino (elara) <alex@midokura.com>
Fixed state check to support older and newer versions of ember.

Signed-off-by: Alessandro D'Aquino (elara) <alex@midokura.com>