CFile: fix null pointer dereference in Stat() and Write()

as title