Fix/workaround for cycles crash when enabling it for preview renders.

Problem is that preview render database is being used, but the new datablock
function still uses G.main, and the mesh was being added to one database but
(attempted to be) removed from another. The proper fix would get rid of the
globals here, will look into that later.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@54082 954f8c5b-7b00-dc11-b283-0030488c597c