Support old versions of ExtUtils::MM_Win32 that lack some functions
Fix substr length calculation

We must substract both $pos and length('CCFLAGS = ') from length($dlib).