Compiler: put toplevel try..catch statements inside an anonymous function

V8 does not optimize functions that contain such statements.
Fixes #226.