fdo#72928: fix deadlocks in librdf_Repository

Refactor to do all calls on parameters before locking the mutex.
This requires splitting up some librdf_TypeConverter methods into an
extract function and a make function, with an intermediate
representation between.
Also rename some internal functions to make it clear which are called
with Lock and which with NoLock.

(cherry picked from commit 7db6b2f7968d8063b12312737136f09cb7549805)

squashed: librdf_Repository: make older compilers happy
(cherry picked from commit d3aad81268298c05163136e2e953e1dfe0728d9e)

Change-Id: Iddc42461d95351785578ef6a80fbf5d056356c16
Reviewed-on: https://gerrit.libreoffice.org/7337
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Tested-by: Jan-Marek Glogowski <glogow@fbihome.de>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>