Fix pari_mainstack_mreset() on Cygwin

Rejected upstream because Cygwin is considered a dead platform

diff --git a/src/language/init.c b/src/language/init.c
index 2d13684..6ea2888 100644
--- a/src/language/init.c
+++ b/src/language/init.c
@@ -653,8 +653,8 @@ pari_mainstack_mfree(void *s, size_t size)
 /* Completely discard the memory mapped between the addresses "from"
  * and "to" (which must be page-aligned).
  *
- * We use mmap() with PROT_NONE, which means that the underlying memory
- * is freed and that the kernel should not commit memory for it. We
+ * We (generally) use mmap() with PROT_NONE, which means that the underlying
+ * memory is freed and that the kernel should not commit memory for it. We
  * still keep the mapping such that we can change the flags to
  * PROT_READ|PROT_WRITE later.
  *
@@ -662,7 +662,12 @@ pari_mainstack_mfree(void *s, size_t size)
  * calling mprotect(..., PROT_NONE) because the latter will keep the
  * memory committed (this is in particular relevant on Linux with
  * vm.overcommit = 2). This remains true even when calling
- * madvise(..., MADV_DONTNEED). */
+ * madvise(..., MADV_DONTNEED).
+ *
+ * Unfortunately, the opposite is true on Cygwin--there, calling
+ * mprotect(..., PROT_NONE) does in fact decommit / free the mapped
+ * memory. Meanwhile there is a known bug that prevents already mapped
+ * memory to be re-mapped with MAP_FIXED and different protection flags. */
 static void
 pari_mainstack_mreset(pari_sp from, pari_sp to)
 {
@@ -671,9 +676,13 @@ pari_mainstack_mreset(pari_sp from, pari_sp to)
   if (!s) return;
 
   addr = (void*)from;
+#ifdef __CYGWIN__
+  if (mprotect(addr, s, PROT_NONE)) pari_err(e_MEM);
+#else
   res = mmap(addr, s, PROT_NONE,
              MAP_FIXED|MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0);
   if (res != addr) pari_err(e_MEM);
+#endif
 }
 
 /* Commit (make available) the virtual memory mapped between the
