EMI/GRIM/TINYGL: fix compile warnings and coverity issues

This patch set fixes a couple of compile warnings and should also address one issue reported by coverity (can't use delete on void* pointers).