Code cleanup: style
UI: higher precision for IK poll angle
Freestyle: Fix for operator error messages with no active line set and associated line style.

This commit amends a de-duplication of error messages in the commit rB6067fa682b0c.
Freestyle: Fix for viewport render not updating with changes of Freestyle settings.
Fix T40508: Calculating normals crashes
Code cleanup: remove redundant void*->int->bool cast on NULL pointer
Fix for missing visits of Freestyle-related ID data blocks in BKE_library_foreach_ID_link().
Fix for missing visits of ID's within SceneRenderLayer in BKE_library_foreach_ID_link().

Just noticed them while working on the previous commit (rB00f722042c07).
Fix T40282: Renaming node sockets in Cycles nodes causes crash.

Cycles expects to find all node sockets with their correct names, but
this can be changed via the API (see bug report discussion).

Solution for now is to let cycles accept this case gracefully instead
of crashing. The shader will simply use the internal default values for
inputs and any connections will be ignored.

Would be nice to report the error somewhere, but cycles doesn't have a
proper logging system for this purpose yet.
Fix compilation error after recent changes

fmc->script is a text datablock, for which we need to
access to it's IT property.
Fix T40522: Viewport layer name is not redrawed.

Yet another missing redraw flag catching (only affecting Cycles, in this case).
Fix T40519: Keyed parameter are not redrawed

The issue has been introduced in 1fabfc9 by changing
notifiers being sent.
Fix T38668: When using Maya Input style, there is no way to snap Knife tool to midpoints
Fix T40520: Properties panel in properties region in 3D view does not go away.

Ignore '_RNA_UI' IDP...
Fix T40370: cycles CUDA baking timeout with high number of AA samples.

Now baking does one AA sample at a time, just like final render. There is
also some code for shader antialiasing that solves T40369 but it is disabled
for now because there may be unpredictable side effects.
BMesh: avoid OpenMP use for low poly meshes (counting selection)

also use schedule(static) for simple for loops.
Fix T40514: Cycles world MIS segfault
OSX: Ideasman does not like using utsname, so i use the always satisfactorily working sysctl method now for runtime OS detection
Replace open() with BLI_open
Fix T40510, revert openmp thread count to how it was in
2.70 for non Apple systems.

Also refactored the code that restores the previous openmp thread count.
The logic here was weird, mostly due to all the commit madness with
Apple openmp support. The restored thread count though should not depend
on the on/off state of threaded sculpting (since it has to do with
systems other than sculpting only). For OSX threads are restored to the
system thread count but Jens should recheck here.