Calling the builtin function 'sort' on an array wrapped in an ES6
proxy results in "illegal access" being thrown (a string, not an
Error). This is probably related in some way to these issues:
This change fixes the problem for the time being through a rather
explicit workaround; if the issue also occurs for other functions, it
will likely surface again.
(also, the change in Session.js makes sure error log entry is nicely
formatted even when strings are thrown)