Initialize and use device’s dev_id

dev_id is never initialized and defaults to 0. Correct code which did
not access device_ptrs with dev_id. Fixes segfault with multiple basic
devices (i.e. POCL_DEVICES="basic basic").