[rust] Fix some oddities of rustc_staticlib

Previously, if `name` was unset, `rustc_staticlib`'s outputs would
have long, nonsensical names. This change forwards on the target_name
parameter as `name` when `name` is unset to prevent this.

This change also moves from using `get_target_outputs` to recalculating
the path to the output binary, since `get_target_outputs` would also
include any test binaries generated as part of the build target.

Test: successfully built a rustc_staticlib target that contained
`with_unit_tests = true`.

Change-Id: I45b0f4cf18c064d0159e93497f3931ded0710d7d
1 file changed