ReplaceExtension had an unexpected behaviour when the file did not have
an extension. In certain cases, the final path would be severely
trimmed: out/.intermediates/my_file would become out/.new_extension.
Explicitly handle the case by appending the new extension.
Test: Run checkbuild on Android Soong
Change-Id: Ie27a98845894cfaee5af5e2a02d44168c40ed821
This is an imported pull request from
https://github.com/google/blueprint/pull/345
GitOrigin-RevId: f9166c0e6151499b4b1a23b89b0bc133203a1116
Change-Id: I63f0798177545792440b8a84b04f1090590f1642