Exit from src/compiler.js with a nonzero return code on exception.

Replaces #2453.