Fix bug with mode parameter not passed to os.mkdir