function exit(code) {
    setTimeout(function(){ phantom.exit(code); }, 0);
    phantom.onError = function(){};
}
Exits without triggering "Unsafe javascript attempt" output.  See
{@link https://github.com/ariya/phantomjs/issues/12697}

@param page the Page object
@param code the exit code