OCaml implementation of glob matching