libc: add scandir() from musl

Add missing scandir() function from musl 1.0.0. Fixes #237.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>