fix bug 1062856 - Prevent ISE on kumascript errors within preview

Supersedes https://github.com/mozilla/kuma/pull/2815 with rebase to fix travis ci build.