Fix T40556: Curve Modifier does not work when used in a Background scene

A bit hackish solution for now, cleaner solution we'll look into as a
part of the new DAG project, when it's clear what kind of data is passed
to the evaluation callbacks.
Second attempt to fix T40833: Crash when rendering with freestyle.

The cause of the crash was identified in an uninitialized member variable
`Main->lock`.  Now that struct Main has a few member variables whose
values are dynamically allocated, per-render Freestyle-specific Main data
structures will be allocated and released using `BKE_main_new()` and
`BKE_main_free()`, respectively.

This revision complements the commit rB6135556f4556.
Fix T40903: Rendering: Alpha Channel is Broken
Fix for segmentation fault in pipeline (freestyle/wm related)
Fix T40257: Frustum culling not working properly

Adding a hack so that KX_GameObjects' culling status is updated based on
mesh slots.
Cleanup: Update list and remove ifdef here.
Cleanup: Remove unused checks in CUDA device code.
Cycles: Update CUDA error messages, based on Toolkit 6.0.

* Removed deprecated erros, and added some new ones, which might help to figure out problems in the future.
Added missing G_DEBUG_DEPSGRAPH flag entry in the bpy.app.debug getters/setters list.
Fix T40364: Texture images are not properly displayed in the material preview in BI when using SSS

Blender Internal only uses materials with non-zero user counter for SSS and new
mutable libblock copy was keeping users counter at zero.

Now it sets user counter to 1, which is a bit of arguable decision, but which
also kind of makes sense -- meaning callee owns the copied block.
Fix T40815: Particle birth times not initialized correctly.

In rB78c491e the `initialize_particle` function was split into 2 parts for particle texture initialization.
The texture init part however also initializes birth times, which is now missing in the main init function
in some cases (notably when setting start/end directly without a subsequent time step).
Fix T40823 LoD Add and Remove crash without valid object

Changed the polling method used for both the add and remove LoD operators
to a more appropriate one.
Fix scons unable to build with sources tar archive (no git repo available in this case).

Reported by Clouclou over IRC, thanks!
Correct recent fix for knife in camera ortho mode

now use real view clip ranges for win-to-ray segment
Mistake in last commit
Follow-up to rBcc1372546ad5: Fix for segmentation fault in pipeline (freestyle/wm related).

Render->freestyle_bmain is set to NULL after BKE_main_free() so that
the struct Main is not considered for tagging any longer.
Fix T40912: Collision Callbacks Don't Work if Set Directly
Correct version check for tip color
Fix T40923: An error from a python controller on a LibFreed object causes a crash
Slight cleanup for 4af848e.