Ensure sorted order on links to make unit test deterministic

Signed-off-by: Maxime Petazzoni <max@signalfuse.com>