Fix wait condition in ProcessWriteTasks().
Fix possible crash in destruction -- don't queue write in DoTask if Prefetch is destructing. In ReadInBlocks() add  missing dec-ref-cnt from the previous commit.