sleep before exit to print the log messages
add a test to illustrate corrupted wal
add some logging to the wal recovery
make closing a wal safe
log a message when we rotate the log
add some logging to log.go
fix #274. open a new fd for replay

Since we have to seek to the right location of the file, we cannot use
the same fd or dup it. File descriptors share the same file location.
fix a typo in the replay logic, we should read from the new file