fix crash by using getFileData to read text files.

the buffer got by getFileData is not end by zero, if use strlen and so on then app may crash.(eg. CCUserDefault->getXMLNodeForKey)
I think it is safe to alloc a buffer that end by zero,and return then real size. image data is also ok.