Fix memory leak

Use std::string for shader source and cleanup shader resources when
compilation fails.