Track types correctly on Argument buffers

Fixes a bug in the C backend - the last commit was casting
buffers to incorrect types.
Buffers track their source modules

This is instead of holding onto function pointers within them.
The pointers might be invalidated when the source module dies.

Also added a bunch more documentation to Buffer objects, and
cleanups relating to host/device logic.

Also Buffers aren't so const now, because you might want to modify
them (e.g. setting dirty bits).

Also renamed halide_free_buffer to halide_free_dev_buffer, because
I was getting confused.