fix #285. WAL should recover from files ending prematurely