Don't build extra object with -no-hs-main
We don't need to compile/link an additional empty C file when it is not needed.
This patch may also fix #18938 (closed) by avoiding trying to lookup the RTS unit when there is none (yet) in the unit database.