work around windows dllexport issue

Since we can't use any discid_* functions anywhere else other than in disc.c on Windows due to the __declspec(dllexport),
we have to move the code to some place where we can also access it internally.

It's just 4 lines, but we have to make sure both places use the same code. Otherwise we get weird issues.