Make strings robust to regular expression variables. (#2255)
The theory solver for strings does not support regular expression variables. With this PR, we properly throw an exception if it is given one.
However, the rewriter needs to handle regular expression variables (for various reasons: rewriting an expression before its asserted, sygus explanation generalization, etc.). This corrects a few miscellaneous issues in the strings rewriter to make it sound for these cases.
It also corrects a seg fault in simpleRegexpConsume when testing memberships `(str.in.re "" R)`, where R is a *non-constant* regular expression (which will now be allowed if variables are allowed).
This is in preparation for adding `RegLan` as a token to the smt2/sygus parsers.