Issue 9723 - Add -main switch to generate stub main() function.

http://d.puremagic.com/issues/show_bug.cgi?id=9723

It's implemented in a similar fashion to RDMD, except the error message will point to the user-defined main function rather than the generated one, and the diagnostic error is nicer.

Not tested on Posix, hopefully it goes green.