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.

Change-Id: Iddc42461d95351785578ef6a80fbf5d056356c16
librdf_Repository: fix missing mutex lock in various destructors

Change-Id: I5756ab6ff6de0b2532bef9866063f361e330a009