protect agains infinte loop when creating tar, issue #4107
Merge pull request #4116 from qunox/infiniteloop

protect agains infinte loop when creating tar, issue #4107