copy and rename should pass name instead of dname when makedirs is true

makedirs_ already calls os.path.dirname on the path provided, and so cuts off the lowest level directory when dname is passed in copy and rename. This fixes that.