fix #220: the first entry is not necessarily a directory

in that case, we use dirname() on the first entry

see also http://stackoverflow.com/questions/23691521/problems-with-runurl-in-shiny