core: Fix compiling libcore as a dylib

This hack will not be needed when the compiler properly supports libcore only
existing as an rlib, not as a dylib.