Write debug log file in most argument processing error scenarios
When the debug mode is enabled, ccache writes the log to
<objectfile>.ccache-log, but that can only be done if the object file
location has been determined. If an unsupported compiler option is
detected, ccache exits early and may not yet have determined the output
object filename.
Fix this by parsing all compiler options, then determining the object
file location and only then return an error from the process_args
function with. This will in practice make the debug mode work for most
invocations. There are still edge cases where it won’t work or will be
potentially confusing, for instance these:
Naturally, no debug log file will be written in the first case. In the
second case no debug log file will be written either since ccache
doesn’t consider a nonexistent file to be an input file. In the third
case the debug log file will be written foo.o.ccache-log but not
bar.o.ccache-log.