common: Factor out function to get OS name