Entropy production in heavy-ion collisions due to rapid phase transitions