Move the Python check top-level

Otherwise we won't see HAVE_PYTHON in config.h.