lib: add `union_find`, a union–find algorithm with a disjoint-set data structure

Signed-off-by: Jean Privat <jean@pryen.org>
Merge: lib: add `union_find`, a union–find algorithm with a disjoint-set data structure

Pull-Request: #446
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>