Closes #9795 (Stata writer changes input frame)
closes #9795 

Just needed to move the data frame copy earlier in the execution path.

awesome!

pls add a release note in v0.16.1.txt
 merged via https://github.com/pydata/pandas/commit/52a30d93a9d153ba1d8b30c430f6c49a6ce461c4
 thanks!
