fixed WAL recovery which hung in certain conditions