Use major.minor format in the version string of the configuration file

Only the first three characters of `sphinx.__version__` are used to compare with `needs_sphinx`. This fixes a bug reported to the astropy mailing list by Russell Hewett.