fix some warnings to report correct function
handle missing ARB_vertex_array_object extension more graceful

Based on patch by Michael Raab.
fixed: fetch iterator after potential clear (thanks to K. Schwenk for the patch)