Fix coverity scan's warning (delete-array's type, not initialized variable and checking return-value of open-syscall)