Added pthreads to CMakeLists.txt
Fixed memcpy in partition_db