Fix T38316: Half of a Face is Missing on Newly Created Cubes or Cylinders.

Own bug from rBc691551249f3. Now at least I understand why `test_index_face()` is needed for tessellated quads!

Added a bunch of comments to explain the issue, as it's far from an obvious one...

We loose some performances, but it's still much quicker than org code.
Memory allocation: do not use mmap for memory allocation on 64 bit.

On Windows we can only do mmap memory allocation up to 4 GB, which causes a
crash when doing very large renders on 64 bit systems with a lot of memory.

As far as I can tell the reason to use mmap is to get around address space
limitation on some 32 bit operating systems, and I can't see a reason to use
it on 64 bit. For the original explanation see here:
http://orange.blender.org/blog/stupid-memory-problems

Fixes T37841.
Fix T38311: cycles BVH cache crash on Windows.
Tab theme colors

patch D234 from Jonathan Williamson with edits

- de-duplicate rna_def_userdef_theme_space_gradient and rna_def_userdef_theme_space_generic
- ui_theme_init_new_do now always sets theme settings (no need to test),
  used by bpy.ops.ui.reset_default_theme()
Themes: update for tab colors
Fix T38325: Game Engine Bitmap fonts failed for characters >128
BGE Bitmap Text: add in check if the character is outside the range
Fix T38110: GameEngine keyboard sensor ignores unicode characters
Fix T38328: GLSL display shows texture mapping completely messed up in some cases

Own stupid typo in rB28ca299d4dfc...
WM: add WM_operatortype_remove_ptr to remove a known operator
Fix T38042: Keymap crash after reloading operators

After some investigation with mont29, seems like the best way to ensure
keymaps point to valid operators is using WM_keyconfig_update().
Removed the omat matrix from DupliObject.

This was storing the original object matrix, which builds on the
assumption that obmat is modified during dupli construction, which is a
bad hack.

Now the obmats are still modified, but this only happens outside of the
dupli system itself and the original ("omat") is stored as local
variables in the same place where the obmat manipulation takes place.
This is easier to follow and avoids hidden hacks as much as possible.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D254
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).