Cycles: Remove redundant alloc/free

Seems like a copy paste error.
Cleanup/fix from latest coverity report.

Mostly harmless things, though the 'multires' error was a real bug.
Cleanup: mostly use bools for booleans.
Cleanup: style
Fix for 3D Ruler crash maximizing view
OpenGL: double width lines is no-longer apple-only
Fix connect-vertices failing for concave ngons

Also add:
- generic callback for bmesh elements.
- ability to pass an existing array to a bmesh operator.
Fix typo breaking compilation with SSE2.

Spotted by sybrenstuvel (Sybren Stüvel), thanks!
BMesh: arg reorder
Compilation error fix for buildbot

Ghost depends on glew-mx, so glew-mx should be passed to linker after the ghost.

We're also using spaces for indentation in python, including scons rules.
OSX/fsmenu: fix compiling on older gcc reported by Mike S
Fix indetation in last commit
Cleanup: defines -> enums, bitshifts for bitflags definitions.
Cleanup: remove rarely used IDProp iterator
Optimization of parallel range

It now supports different scheduling schemas: dynamic and static.
Static one is the default and it splits work into equal number of
range iterations.

Dynamic one allocates chunks of 32 iterations which then being
dynamically send to a thread which is currently idling.

This gives slightly better performance. Still some tricks are
possible to have. For example we can use some smarter static scheduling
when one thread might steal tasks from another threads when it runs
out of work to be done.

Also removed unneeded spin lock in the mesh deform evaluation,
on the first glance it seemed to be a reduction involved here but
int fact threads are just adding value to the original vertex
coordinates. No write access to the same element of  vertexCos
happens from separate threads.
Fix T42233: Python property ignores 'PROPORTIONAL'
Cleanup: spelling (D831)
CMake: Attempted to copy manual for py-module
Fix use-after free (own error)
Add missing `CustomData_duplicate_referenced_layer_n` and deduplicate code.

CustomData_duplicate_referenced_layer_n not used in master currently, but need it
in mesh tranfer branch.