bpo-35081: Move Py_BUILD_CORE code to internal/mem.h (GH-10249)

* Add #include "internal/mem.h" to C files using
  _PyMem_SetDefaultAllocator().
* Include/internal/mem.h now requires Py_BUILD_CORE to be defined.
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c
index fbc9478..88ded83 100644
--- a/Objects/obmalloc.c
+++ b/Objects/obmalloc.c
@@ -1,4 +1,5 @@
 #include "Python.h"
+#include "internal/mem.h"
 
 #include <stdbool.h>