ooxml: fixed a number of potential memory issues