Fix T38284: Crash with several shrinkwrap constraint using same target

Issue is caused by the race condition between getting custom data layers
from target's derived mesh (for vertices and faces) and releasing this
derived mesh from other threads.

When one releases the derived mesh it'll free temporary data from it,
and it'll also update data layers mapping.

General rule for threading is that no one is ever allowed to modify
data he doesn't own. This means that no temp layers are to be allocated
in derived mesh and making it so `CustomData_free_temporary()` doesn't
update mapping if nothing was freed will solve the race condition.

It is still possible to do other improvements, namely detect which
additional data/layers are to be present in derived mesh and create
it as a part of `object_handle_update()`, but this is to be solved
separately.
Fix for IMB_(un)premultiply_rect_float() not doing right business

- Made them receive number of channels rather than number of planes.
  This matches to how ImBuf structure stored planes and channels.
- IMB_premultiply_rect_float() was called with channels passed instead
  of planes already :S.
Fix typo in mmap commit from a while ago
Code Cleanup: find operator once and reuse
Code Cleanup: whitespace
Fix for crash getting the name of RNA properties with empty name
Fix crash when changing space type to 3D space when having multiple windows

it is possible that different windows shares scene but displays different
layers. And it's also possible that different areas in the same window will
show different layers.

First case was violated in `dag_current_scene_layers()` which only checked
scene layers only once and if multiple windows shares the same scene only
one window was handled. Now made it so layers from all windows will be
squashed together into a single `DagSceneLayer`. This mainly solves issue
with `DAG_on_visible_update()` which didn't work reliable with multiple
open windows.

Second case required call of `DAG_on_visible_update()` when changing space
are type.

This commit slows things a bit actually because `dag_current_scene_layers()`
is actually called on every main WM loop iteration. It is possible to speed
some logic up perhaps. Not sure it's so much critical to do now because there
are unlikely to be more than few windows open anyway.

Will rather think of skipping all that flushing things if no objects are
tagged for update actually.
Cleanup: int/short to bool in BKE_cdderivedmesh.h functions (and TRUE/FALSE to true/false in code using them).
Fix T37685: automatic weights affected by face masking outside weight paint mode.

Only when in weight paint mode should it check the selected vertices and faces,
in object mode it should just affect the entire mesh.
Fix T37302: cycles slow hair export with many hairs, especially on Windows.
Fix T36165: blender internal HDR textures with negative values got clamped.

For example for vector displacement, you may have an EXR texture that has
negative colors values. Blender clamps these by default, now the Colors panel
for textures has a Clamp option to disable this clamping.

This option affects all texture types and is enabled by default, you need
to disable it if you want negative values to have an influence.

Patch by Fredrik Hansson with modifications by me.
Fix T38337: Crash when calling to_mesh() on a Curve object after clearing its parent

This is rather a workaround which only works because curve evaluation is only called
for a temporary object. Not a big deal if we'll skip path creation for such objects.

Still would need to think of general solution.
Make Tab Divider interopolate between the region background and tab outline.

Previously the divider was using the region background and the region text, leading to bad outlines with custom themes. This makes the outline behave more expectedly and allows better control.
Fix T38150: implementation mismatch in bmesh python

Hopefully this time all mismatches are fixed (quickly checked the whole BMesh API files,
found a few others in addition to those reported in T38150).
Add support for new "bl_category" member (new panels "tabs" system).
game engine: implement hitMaterial for collision and ray sensors

Reviewed By: moguri, kupoman

Differential Revision: https://developer.blender.org/D167
Fix compilation error caused by 67f1fd2

Did one tried building blender before commit even?
Fix currently harmless issue with converting ImBuf from sequencer space
Cycles Standalone: Add a help message, which appears when pressing the "h" key.

This is very basic for now, but can be extended with more info (available devices for example) later.

Thanks to Bastien and Sergey for some help with the glRect coordinates stuff.
Make multisegment bevel profiles even for all parameters.

The method for calculating points on the profile for non-circles
and non-lines meant that the segments making up an edge had
uneven widths.
Use a numeric search technique to find superellipse evaluation
points that lead to equal-sized chords across the profile.
Also calculate the actual profile points sooner, so that they
don't have to be recalculated again and again.
This also sets up for a possible later feature of arbitrary
profile shapes, set by user.