Add find_first_dir_with_file() function

Signed-off-by: Tomas Hozza <thozza@redhat.com>