Fix bug when a directory with the right name appears in the PATH

See https://github.com/ocaml/opam-repository/issues/1306
Merge pull request #30 from samoht/robust-path

Fix an hard-to-track bug when PATH contains garbage