flux-module: fix segfault loading out of tree mod

flux-module would segfault in some cases when searching the module
path, if the glob matched a file that could not be dlopened or which
was not a module.