Layout
CLEANUP: Counting mutex implementation:  Use inline functions for
better readability, use a 64 bit int for counting locks.
ENHANCED: Use double-linked lists for keeping track of counting
mutexes.  Avoids quadratic behaviour e.g., abolish/1 of many
dynamic predicates.  Abramo Bagnara.