Handle repeated calls to halide_dev_malloc correctly