More fixes to OpenGL runtime
More fixes to OpenGL runtime

There were several places (notably halide_opengl_device_malloc) that
should have been checking for buf->dev == 0 but were not, leading to
odd quiet failures when running in “opaque” mode.


Former-commit-id: 3616892f6af2aad4a2d725f365c1fcb7d4daf57f
Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide