Fixed the memory leak. Refs #7506.

Memory leak is caused by mistakenly using ws.dataX(spectrum), which
causes a copy operatoin on vector, other than ws.readX(spectrum). As it
is not threading safe, the memory leak occurs.