Fix compatibility with Rails 4 browser error reporting

Rails 4 has introduced a new way of code extraction for browser error
reporting.

If a syntax error occurred in template, we should prepend to the
backtrace template's filename and line.

Also, extend syntax error tests to the introduced case.