fix up temp objects and make copyfrom work for big objects

Still testing this, but it's ready for review.

Last two patches add some mutual exclusion so that other ops block
during the COPY_FROM op.