configure: more resilient Python version capture