Fixed incorrect usage of delete for array in Index::read (should have been delete[], replaced with unique_ptr which is even better).
Switched mkTempDir to use unique_ptr for working with string buffer.