Fix memory leak

free dirent_list[i] even if open_device returns an error.

Signed-off-by: Andy Grover <agrover@redhat.com>