Fix handling of paths with white spaces

I noticed that bd is badly broken when dealing with paths containing white spaces.
Example:

    # pwd
    /home/voria/a/b/c e/d f g

If I autocomplete bd:

    # bd <autocomplete>
    g      f      d      e      c      b      a      voria  home   /

I can even choose "f" from the list:

     # bd f
     # pwd
     /home/voria/a/b/c e

To fix this the logic used to get the list of parent directories has to be completely changed.