Add unique IDs to edges

Edges are nominally ordered by order in the build manifest, but in
fact are ordered by memory address.  In most cases the memory address
will be monontonically increasing.  Since serialized build output will
need unique IDs, add a monotonically increasing ID to edges, and use
that for sorting instead of memory address.

(cherry-picked from commit 3ca0e1b6c9f6106e983c0806eb92ad96dc8c3b37)

Change-Id: I494a3946e187d3a4aeb9268af603172b575661c5
7 files changed