Fix deepcopy of shared variable due to a Numpy problem.

The fix is taken from debugmode.
This fix a bug in the daily buildbot