Tesco has been fined after delivering a cake that had been partially eaten by mice to a customer's house.