Devices: fix wrongly placed assert and device count iteration

Fix for potential problems
Fix a segfault when image type was not supported due to mem not beeing initialized
Remove the ERROR_CLEAN_DEV label since clCreateBuffer handle the freeing operation by itself when an error happens