Fix AVX2 CPU detection on some systems

A strange corner case related to max_extended_cap caused it to be detected
on systems where it wasn't really supported.