Output file writeability check; fix exit code on thread abort