corrected segv on close due to invalid call to command queue to get device id, while the command
queue was already released.