fix incorrect handling of multiple pending puts when closing