libfdisk: add generic function to check partitions order

Signed-off-by: Karel Zak <kzak@redhat.com>