Update producer_consumer.c

Update buffer free logic