Move logic for detecting different kinds of externs to cargo_out.

This will work differently when not running cargo.

Bug: 293289578
Test: atest cargo_embargo.test
Change-Id: I6c7b1f6266d7d66bcbb68387d06f59306695008e
5 files changed