Ensure SYMPY_DEBUG env variable contains only True or False

Evaluating it unchecked is an unlikely yet possible vector of attack,
e.g. one can gain root privileges if there's a script importing sympy
with setuid bit on it.
Merge pull request #8146 from immerrr/strict-eval-of-sympy-debug

Don't evaluate arbitrary text coming from SYMPY_DEBUG variable