BW incompatible bug fixes!!!

Note that the representation of write lock entries has changed!

Merging of child locks could sometimes result in redundant entries,
empty read locks, etc. Also, merged queues must be able to accept
multiple indirect write entries on the same resource. This is not a
problem for the dependency analysis, but the #w{} record had to be
modified. No code change code has been written as I am not aware of
anyone actually using locks in live operation at this time.

Dependency analysis in the agents did not account for the possibility
of having dependencies to oneself. This can happen e.g. when trying
to upgrade a read lock, and the upgrade is blocked by a read lock
on a child, held by another agent.