Use diagonal preconditioner for density matrix, also properly set threads in total_dynamix