handle XSB errors. flush stderr from xsb.