Ensure the main thread terminates if compilation fails

fixes AccelerateHS/accelerate#212