An intelligent food label that tells consumers how long they have to eat a product after it has been opened could solve one of grocery’s great conundrums.