Fix setting parseError in calculator

Summary:
Taken from D5922 until it's decided what to do with that.  Previously
the code was attempting to set an error handler which would allow the
calculator to catch any parse errors, since that was not set correctly,
any parsing errors (such as "(") cause a javascript error and scroll the
page to the top.

Test Plan:
* open an exercise with a calculator (like standard deviation)
* put some malformed input in, like 'sqrt(', hit enter
* the calculator should output 'err' and there shouldn't be a javascript error.

Auditors: alex