libgenlock: add support for genlock_write_to_read locking semantics

In order to support synchronization with a single genlock
handle the API no longer automatically reduces a write
lock to a read lock and a write lock can wait for a read
lock in the same genlock handle.

CRs-fixed: 356263
Change-Id: I2f6e4d9a5e6a9b663137d5a86df5a198b97ea271