qapi/expr.py: move string check upwards in check_type