On AOF end of file, truncate the AOF to last valid command.
On AOF end of file, truncate the AOF to last valid command.

Recently we introduced the ability to load truncated AOFs, but
unfortuantely the support was broken since the server, after loading the
truncated AOF, continues appending to the file that is corrupted at the
end. The problem is fixed only in the next AOF rewrite.

This commit fixes the issue by truncating the AOF to the last valid
opcode, and aborting if it is not possible to truncate the file
correctly.

splitice/redis,himoca/redis,slfs007/mk-redis,spearhead-ea/redis,ramonsnir/redis,ksarch-saas/redis,xuzhezhaozhao/redis_reading,MSOpenTech/redis,HunanTV/redis,MSOpenTech/redis,ttuna/msot-redis,himoca/redis,darksideofthemoo/redis-histogram,ttuna/msot-redis,xuzhezhaozhao/redis_reading,splitice/redis,slfs007/mk-redis,louisliangjun/redis,splitice/redis,maodeyi/redis_lua,louisliangjun/redis,ksarch-saas/redis,HunanTV/redis,louisliangjun/redis,maodeyi/redis_lua,ttuna/msot-redis,jxwr/redis,MSOpenTech/redis,ttuna/msot-redis,darksideofthemoo/redis-histogram,splitice/redis,ttuna/msot-redis,jxwr/redis,himoca/redis,xuzhezhaozhao/redis_reading,HunanTV/redis,ramonsnir/redis,ksarch-saas/redis,maodeyi/redis_lua,xuzhezhaozhao/redis_reading,ramonsnir/redis,louisliangjun/redis,jxwr/redis,ksarch-saas/redis,HunanTV/redis,slfs007/mk-redis,spearhead-ea/redis,MSOpenTech/redis,darksideofthemoo/redis-histogram,spearhead-ea/redis,darksideofthemoo/redis-histogram,MSOpenTech/redis