rustc: Move code for discovering the crate entry point into its own pass

It doesn't have anything to do with resolve and the logic will likely get
more involved in the future, after #4433
rustc: Only accept main functions at the crate level. #4433
rustc: Fix the logic for finding the Android main function

I don't understand what this logic is doing
auto merge of #6119 : brson/rust/main, r=brson

r? @ILyoan

This pulls all the logic for discovering the crate entry point into a new pass (out of resolve and typeck), then changes it so that main is only looked for at the crate level (`#[main]` can still be used anywhere).

I don't understand the special android logic here and worry that I may have broken it.