recovery: moved lock to the very start of recovery
recovery: improve logging

Now we saving all output to rotating logfile, so admins can use them in
post-mortems.