Fix genCmain code to remove ambiguity of `&main` expression

It was introduced by pull#2476, but the expression `&main` which is implicitly
inserted would conflict with two extern(C) and (D) "main" functions in
user module.

Instead, separate the entry-point code in the hidden module __entrypoint.d

Compiler will emit the generated C-main code in the same object file that
contains D-main code.
Fix compiler segfault with main function and -lib switch
Merge pull request #2540 from 9rnsr/fix_main

Fix genCmain code to remove ambiguity of `&main` expression