osdeps: move parsing of AUTOPROJ_OS at the top of operating_system

The previous commit broke the case where we already detected some
operating system (it is therefore cached) and one sets AUTOPROJ_OS.