bson: fixed writing to file to safely write all bytes in buffer
bson: fixed writing to file to safely write all bytes in buffer

wenluhu/gammaray-android,wenluhu/gammaray-android,cmusatyalab/gammaray,wenluhu/gammaray-android,cmusatyalab/gammaray,cmusatyalab/gammaray