Fix some problematic optimizations on select, GCC compatibility
Fix header generation for unsafe externals
Adds External-Unsafe for external buffers without initializer