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

Please put a message to the log file to notice the reason why the program terminated.