Write dependency info (--dep-info) to a file name based on compiler output

This changes the name of the file that Makefile-compatible dependency info are written to when using --dep-info. The new filename is based on the compiler output filename with the extension replaced by `.d`.

The previous file name was based on the crate source filename. That made it difficult to produce dep-info for Makefiles that create multiple targets from a single crate source (e.g. a Makefile that compiles a crate file with different --cfg settings, or a main crate file that also contains tests). Previously, dep-info from the first rustc run were overwritten with different dep-info by the second rustc run (since both named it `lib.d`). With this PR, the dep-info is written to a filename that is based on the output, which avoids conflicting names.

cc #10698
cc @metajack