Make freestyle use local Main for temporary objects

This means main database is no longer pollutes with
temporary scene and objects needed for freestyle
render.

Actually, there're few of separated temporary mains
now. Ideally it's better to use single one, but it's
not so much trivial to pass it to all classes. Not
so big deal actually.

Required some changes to blender kernel, to make it
possible to add object to a given main, also to
check on mesh materials for objects in given main.
This is all straightforward changes.

As an additional, solved issue with main database
being infinitely polluted with text blocks created
by create_lineset_handler function.

This fixes:
- #35003: Freestyle crashes if user expands objects in FRS1_Scene
- #35012: ctrl+f12 rendering crashes when using Freestyle

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