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/Python/sysmodule.c b/Python/sysmodule.c
index 9579eae..71414c9 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -15,6 +15,7 @@
 */
 
 #include "Python.h"
+#include "internal/mem.h"
 #include "internal/pystate.h"
 #include "code.h"
 #include "frameobject.h"