Fix filelib:ensure_dir/1

Fix for reported bug:
http://erlang.org/pipermail/erlang-bugs/2014-June/004465.html