OpenCL module state now passed by caller rather than a global object.

This is to allow for multiple modules using the OpenCL runtime to be
linked together without causing issues with the weak halide_dev_*
functions using static global state objects.
Implemented simple linked-list to keep track of module states.

These states need to be released when the context is released, so the
module_state structure is now a linked-list.
Changed allocation of module_state structure to use malloc.
Added assertions to halide_dev_run to ensure module state is valid.
Applied same module state techniques to CUDA runtime.
Merge pull request #238 from jrprice/gpu-module-state

GPU Module State