Fixes handling already existing files in hdfs.mkdir

Also adds unit test to test this functionality