Move logging out of mutex locks. Avoid spawning prefetch thread in IO constructor.