[PHP-680] Reset tag count after freeing tagsets
Merged pull request #283