copy and rename should pass name instead of dname when makedirs is true
Merge pull request #13682 from Tweenagedream/states-file-rename-copy-makedirs-fix

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