6960: Error merging citations

Error merging citations containing objects with citations.
reapply from gramps40 the fix to MergeCitationQuery
merge_ref_test suite still fails :(

git-svn-id: svn+ssh://svn.code.sf.net/p/gramps/code/trunk@22938 4ae1f11a-8b86-4847-b8af-ab372f36d1fd
0006849: citationtreeview with search bar only searches in sources, not citation data
0006848: citationtreeview corrupts when search bar open and edit occurs
0006829: Searching into source/citation selector disallows to select all related citations, only matching rows

by fixing treebasemodel so it properly deals with secondary objects, and also citationtreemodel so it adds secondary odes even when the parent is not present.

git-svn-id: svn+ssh://svn.code.sf.net/p/gramps/code/trunk@22941 4ae1f11a-8b86-4847-b8af-ab372f36d1fd
Fix dbdjango to be up to date with bsddb of gramps40: added checksum for Media; SourceAttribute and CitationAttribute gained a private flag; all primary objects got tags

git-svn-id: svn+ssh://svn.code.sf.net/p/gramps/code/trunk@22944 4ae1f11a-8b86-4847-b8af-ab372f36d1fd
Obsolete checks in __main__

git-svn-id: svn+ssh://svn.code.sf.net/p/gramps/code/trunk@22945 4ae1f11a-8b86-4847-b8af-ab372f36d1fd