Means for controlling the pivoting movement of the headrest of a treatment table or -stuhls