Fixed an issue where the last N load commands in the mach-o core file would not be read in where N was the number of LC_THREAD load commands.

I now properly increment the ncmds for each LC_THREAD and now core files are saved correctly.

<rdar://problem/18312703> 

llvm-svn: 217905
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 67be5a5..c7f3133 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -5349,6 +5349,7 @@
                     // and the size of all LC_THREAD load command
                     for (const auto &LC_THREAD_data : LC_THREAD_datas)
                     {
+                        ++mach_header.ncmds;
                         mach_header.sizeofcmds += 8 + LC_THREAD_data.GetSize();
                     }