Gasket of mastitis detector for milking machines