Improve the infinite recursion detection when parsing playlists.

The parser was sometimes too strict and rejected valid playlists.