Use iostream for saving GL program binary + check GL_NUM_PROGRAM_BINARY_FORMATS  > 0

Fixes https://github.com/mapbox/mapbox-gl-native/issues/728

Also checks GL_NUM_PROGRAM_BINARY_FORMATS for https://github.com/mapbox/mapbox-gl-native/issues/699