Move get_previous_version logic to common/conf.py

Migrate common code to determine pervious series from current release number
to common/conf.py. This logic will be refactored to using git tags eventually.
Use directly this function in contributing/conf.py allowing to pass the number
of the next major release only to determine the stable development branch.