You have to use -MD, both for pike.exe and all modules, when you use dlls. That's the only way to make them share the same CRT instance, which is vital for memory management to work.
I suggest you try with --enable-dll (assuming a recent 7.7) which fixes that and other things. Note that I'm still not finished with the dll stuff. Notably I have a lot of uncommitted changes to make the installer work. Haven't done much about it lately since I'm on vacation and mostly off-net (will still be for another week).