use scandir to sort results

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>