I was able to come up with a fix to the Perl interpreter for this.
If you want to store shared objects inside other shared
structures, you'll need to get Perl 5.10.0 (either build
the lastest snapshot yourself, or wait for an official
release), and then upgrade
threads::shared to version 1.15 or later.