Fix T38043: Text clipping when it shouldn't

Tweak some more 'middle clipping' (zoom issues).
Fix T38045: Clone stamp crashes

Issue seems to be caused by thread-unsafe IMB_freeImBuf.
Now use generic BKE_image_release_ibuf to de-reference
image buffer which was acquired from image datablock.
Fix crash when trying to reset color space to default value
Code refactor: move random number and MIS variables into PathState.

This makes it easier to pass this state around, and wraps some common RNG
dimension computations in utility functions.
Fix cycles OSL volume render crash with multiple closures.
Fix gcc compile error in last commit.
Changed percentage and 0-1 number fields to use sliders. This is more consistent.

Reviewed by Brecht van Lommel, Thomas Dinges and Jonathan Williamson
Object Mode Toolbar Tabs

Summary:
Here are the initial tabs for the 3D View Object Mode toolbar. This is based on the discussions between myself and @billrey in T37569

P.S. apologies for the duplicate. The first one I mistakenly sent to the Edit Mode task, T37568. I have corrected it and also made a couple changes, per @campbellbarton's request.

Reviewers: campbellbarton

CC: campbellbarton, brecht, billrey

Maniphest Tasks: T37569

Differential Revision: http://developer.blender.org/D129
Basic Tab for Object Mode 3D View Toolbar

This updates the organization and naming of the Basic tab for the 3D View toolbar. It reorganizes the tools that were already there and adds Mirror and Duplicate Linked object operators.
Add Mesh buttons for 3D View Toolbar

This adds buttons in the 3D View toolbar to add new mesh objects to the scene. These buttons are added via the Create tab/category, soon to be populated with other object types as well.

A panel is added for both Object mode and Edit mode so as to not display in incorrect context (such as Pose Mode).
Add "Add Curve" buttons to 3D View Toolbar

This creates a series of buttons in the 3D View toolbar to add new curve objects to the scene. This new panel is categorized under the Create tab.
Adding remaining object categories to the Create tab of the 3D View Toolbar.

This adds the remaining object categories to the Create tab, including Nurb Surfaces, Lamps, Meta objects, etc. I've also updated the labeling for the various buttons to be consistent with one another.
Adding Relations category to 3D View Toolbar.

This creates the tab for relations in the toolbar. This tab includes those operators that relate to objects relationships with other objects and data.
Add "Bake Action" to Animation tab of 3D View Toolbar.

This is based on the rationale here, in order to begin giving a more complete set of animation tools to the toolbar: https://developer.blender.org/file/data/hlt2vtyqo4iqwookyack/PHID-FILE-ghcjwtxvl7siwidxlw6b/3D_View_Object_Mode_Tools.png
Add Undo/Redo and Undo History to the History tab of the 3D View Toolbar
Cleanup the Grease Pencil panel of the 3D View Toolbar.

This makes the panel slightly cleaner, giving more separation between the distinct elements. It also adds a new "Measure" label, so that the Ruler/Protractor is not so closely "related" to the Grease Pencil.
Remove individual panels for primitive objects, adding only primary ones.

This makes for a much cleaner panel with a lot less wasted space. Thanks DingTo for the suggestions.
Fix alignment of Grease Pencil options.
Rename "Object" to "Operations" in the 3D View Toolbar Basic tab.

This makes the naming less confusing, since all of the tools apply to objects.
Fix formatting on section names in the Relations tab.