Cycles-Bake: Squash of first commits

I squashed the previous commit to undo the rename of bake.c > bake_old.c
This was merge-conflict prone since any change in the bake.c would generate conflict.

(same for object_bake.c)

* More work on getting cycles to have its bake function called.
* Getting through the beast - bake gets called inside Cycles
* I get a crash though, on free_session()
* Get render pass for baking from enum
* Sending the BakePixel and float pointers all the way to Cycles \o/
* Sending some data back just to validate the pipeline going in and out
Cycles-Bake: fix compile error on linux
Cycles-Bake: RE_populate_bake_pixels() - still need work

(see TODO in the function - in bake_new.c)
Cycles-Bake: suppress result printout
Cycles-Bake: RE_populate_bake_pixels working for triangulated faces

I suspect I need to check if the face is 3 or 4 verts,
but for triangles it's working :)
Cycles-Bake: fixing heap corruption bug

by Tom Edwards
Cycles-Bake: bump primitive id and create new face if tessface has 4 vertices
Cycles-Bake: Saving the baked map externally working + more code

How to test it:

bpy.ops.object.bake(type='UV', filepath='/tmp/bake.jpg', width=512,
height=512, is_save_external=True)

The object needs a UV for this to work.

*** Note:

Also we now separate whether we need to use the external baking or not.
Though, now that I think of it, we should probably always use external
when possible, even for UV. Because that's the only map that will make
sense that is in the 'always internal' group (object id and material id
doesn't make a lot of sense as baking options in my opinion).
Cycles-Bake: better to always use the external engine to bake, the only map that
we could map using the internal mechanism is the UV map
Cycles-Bake: remove the spurious prints from Cycles
Cycles-Bake: bakepixels > bake_pixels
Cycles-Bake: cleanup of comments/todo listing in object_bake_new.c
Cycles-Bake: basic structure to run different baking routines depending on the
pass_type

I'm failing to have this in bake.cpp by the way. Notes in
blender_session.cpp
Cycles-Bake: reverting gibberish code I added earlier
Cycles-Bake: reverting code I shouldn't need
Cycles-Bake: fix Cycles breaking on free()

I may have to tweak this if in the end the result of the render is to be
rendered to a renderresult. If so I may pass width, height to the bake
function and set this as the 'scene' dimensions for the tiles.
Cycles-Bake: report back successful baking and free mem
Cycles-Bake: using BL::BakePixel instead of BakePixel inside Cycles
Cycles-Bake: create BakeManager to be handled via scene

next: create a real BakeManager::bake (based on mesh_displace.cp)
next: expand kernel_displace.h (kernel_shader_evaluate()) for other shader types)
Cycles-Bake: fill the bake() routine to call the shader function

I still need to expand kernel_displace.h so each shadertype gets
properly created.

Also I'm yet to create other shader_types, I'll sak Brecht first to see
if this is the way to go