autoconf: trim duplicated headers

And sort the header list to help maintain uniqueness.

Signed-off-by: Loic Dachary <loic@dachary.org>
Merge pull request #1047 from dachary/wip-duplicated-headers

autoconf: trim duplicated headers