When associating document by URL only, compute correct reference
When associating a document by reference only, i.e. only inserting the
filename/path/URL instead of copying and/or renaming the file next to
the bibliography file, correctly compute the reference based on the
absolute or relative document path, respectively.
This commit fixes a bug where if a relative path for the reference was
chosen, the current entry's id was used erroneously.
Manual forward-port of commit 3c4769dc361ea69e8e48 from branch 'master'
which in its turn is a forward-port of commit 4d611ff6c0c139 from branch
'kbibtex/0.9'.