Sync calls are now performed without lock held
Sync calls were performed by function _g_kdbus_worker_send_message_sync()
called under connection lock. It was not necessary to hold the lock,
and it had side effects: holding another threads that wanted to call
something synchronically.
First argument of the function is connection->kdbus_worker. It is safe
to access this member, because it is read-only and outer context must keep
a reference to the connection, anyway. Worker itself is in turn kept
by reference from the connection.
The function uses only worker's read-only members, which are initialized
once at the creation of worker or connection. The only exception is
'matches' field, which is also modified in 'AddMatch'/'RemoveMatch'
method calls handler.
To sum up: I moved call to _g_kdbus_worker_send_message_sync() out of
connection lock and I have added a dedicated mutex for 'matches'.
Change-Id: I5895e591a9f32f085958b5b422d8b81110bd6c4d