The thickness of the magnetosheath: Constraints on the polytropic index