Bug fix: avoid infinite loop when looking for a declaration. Bug exposed by SVN commit 5383.

git-svn-id: http://yate.null.ro/svn/yate/trunk@5390 acf43c95-373e-0410-b603-e72c3f656dc1