This allows failing cleaner and earlier if unable to write to the output directory. Signed-off-by: Martin Storsjö <martin@martin.st>