Copying scope object should fill filedinit to NULL, due to avoid issue 11777

The bug was introduced by the commit 41b2ba393d879613cdb12b05f143bdf4fef35f6a in the PR #3384, because I had forgotten to pull my issue 11777 fix (done in #3423) into that PR.