Task scheduler: Add an option to limit number of threads per pool

This way we can have scheduler capable of scheduling tasks on all the CPUs
but in the same time we can limit tasks like baking (in the future) to use
no more than given number of threads.
Fix T42421: HDR reader could easily read past buffer (truncated HDR files e.g.) and segfault.

Now readers get an 'mem_eof' guard pointer, and they abort in case they try to go past it.
Bugfix T42648: Invert Selection operator is not working for animation channels

The wrong selection mode was being used/passed to operators.
Bugfix T41527: Animations of world texture properties invisible in anim editors

Was caused by a typo - "items" was used in place of "tmp_items", causing animation
in the texture to get ignored if nothing else was present
CMake: disable OSL if its not found
Bugfix T42048: Keyframes missing when animating particle system blend texture parameters

Textures attached to particle systems are now get their animation data listed
under the particle systems they are attached to now. This is the most convenient
and direct way that these can get included
Cycles: support for specular color in solid shading mode, available in
the material panel.

Patch by Phillipp Oeser (D62) with some minor modifications, thanks!
Cleanup: typo
BMesh: check for loop side-of-loop & side-of-edge
fix T42676 replaced windows specific include by BLI_utildefines.h
Text Editor: incorrect clipping at bottom

Patch T42637 by @donfabio
Fix leftover f postfix from C code.
Bugfix: Duplicating Grease Pencil datablocks wasn't doing so in a safe way

Grease Pencil data (bGPdata) is now a datablock, so it isn't safe to use
MEM_dupallocN() for copying new instances of these anymore.
Fix for previous commit

gpencil_data_duplicate() was being used for gp drawing undo buffers, where using an
exact copy is exactly what we want/need. Instead, the code here now has an additional
arg for determining whether a direct copy is warranted or not.
Bugfix T42549: Grease pencil layers are not scene-specific for "full copy scenes"
Fix T42688: python crash: bpy.context.scene.update().

`ED_render_scene_update()` should ensure it does have some WM to work on...
Math Lib: add constant: M_SQRT1_3 1/sqrt(3)
Cycles UI: Several fixes for recent additions...

* Alpha Property was removed (Fix T42690)
* Some tweaks to make the panel look better again.
* Use abreviated form "Multiple Importance" everywhere, for consistency.
Cleanup: warnings
Refactor: BLI_path_util (split out app directory access)

This module is intended for path manipulation functions
but had utility functions added to access various directories.