qapi/expr.py: Add casts in a few select cases