Fix Pool tests.

At any phase in the test where multiple edges are ready
simultaneously, acquire all edges and sort them into a predictable
order. This allows the test to execute deterministically regardless
of the order of edge allocation.
Fix bootstrap on OS X.

This was broken in 4c552c2c3cbc07acce9c1a379fee054a3f680100.
Merge pull request #570 from nico/fixdarwin

Fix bootstrap on OS X.
Merge pull request #568 from riannucci/fix_test

Fix pool tests (and provide utility to fix other similar issues as well)