Many women are buying less effective pain medication for period cramps, supermarket data suggests.