protect agains infinte loop when creating tar, issue #4107