librustc: Fix edge cases for determining main fn.