test that perl headers don't introduce external references

This is as close as possible to the original Time::HiRes probe code,
further commits will clean that up.

[perl #116989]
remove code for non-core builds and "modernize"
support MSWin32 too