Fix T38024 crash when rebuilding sculpt mode buffers.

Main issue here is that glBuf* calls were invoked from threads different than
main thread. This caused a crash (since those do not have a GL context active).

Fix here is twofold:
* add an ID buffer in buffer pool that handles pbvh buffers and is freed
from main thread when gpu_buffer_pool_free_unused is called.

* do not create glbuffers in derivedmesh creation routine, rather tag nodes
for update and create those in the draw function
(guaranteed to be called from main thread)

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D169
Text3d: error in own recent fix for thread safety
Text3d: remove sepchar, old feature which no longer has any UI access.
Text3d: smallcaps wasnt working properly for text-on-path
Text3d: fix for smallcaps modifying the original text input in editmode.

Oversight in own recent commit to avoid allocating a new wchar_t array.
Text3d: selection in editmode now follows rotated text along path
Code cleanup: preprocessor indentation inside #ifdef block
Fix crash when having multiple text objects sharing the same curve datablock

Issue was caused by BKE_vfont_to_curve() modifying curve->nurbs list which
gave threading issues.

Now added BKE_vfont_to_curve_nubase() which operates on a given nurbs list
base which is local in do_makeDispListCurveTypes().

By the looks of it it wouldn't give speed regression because previously it
also was creating nurbs for every font object sharing the same curve data.
Fix memory leak caused by main library split

Evaluation Context wasn't freed for temporary mains.
Code cleanup: fix type in malloc id string
Text3d: paste additions
- Add paste from system clipboard which behaves like paste from file.
- Paste from file now replaces the selection rather then just adding to the end.
- Move paste operations into the 'Edit' menu.
- Added generic paste functions: font_paste_wchar, font_paste_utf8.
- Fix paste max length check not taking the selection length into account.
Text3d: fix font family feature for unicode and correct tooltip
Text3d: minor edits to the API, remove BKE_vfont_to_curve_nubase_ex
Text3d: font family dupli-objects now follow rotation of the curve path
Fix own error in recent changes curve text storage,

Setting via rna crashed.
UI: Use shift+lmb for toggling panel pinning (not to conflict with MMB emulation)
UI: pin icon was ignoring DPI
Text3d: avoid assert, clamp position before getting the selection
Cycles / OSL: Add a new procedural texture template, Lyapunov fractals.

Based on a patch by Sylvio Sell, OSL port by myself.
Task and example renders: https://developer.blender.org/T32305
Code cleanup / Cycles: else/if for SSE41 kernel functions.