PDFBOX-1780: fixed the handling of direct/indirect references as proposed by vakhtang koroghlishvili

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1541987 13f79535-47bb-0310-9956-ffa450edef68