pic32: Stop COUNTER when debugger stops

COUNTER used for tick timer now stops when execution
is stopped by debugger.
diff --git a/kernel/os/src/arch/pic32/os_arch_pic32.c b/kernel/os/src/arch/pic32/os_arch_pic32.c
index 4e371c1..f4247b3 100644
--- a/kernel/os/src/arch/pic32/os_arch_pic32.c
+++ b/kernel/os/src/arch/pic32/os_arch_pic32.c
@@ -194,6 +194,9 @@
         /* vector spacing 0x20  */
         _CP0_SET_INTCTL(_CP0_GET_INTCTL() | (1 << _CP0_INTCTL_VS_POSITION));
 
+        /* Stop core timer while debugger stops */
+        _CP0_BIC_DEBUG(_CP0_DEBUG_COUNTDM_MASK);
+
         /* enable core timer interrupt */
         IEC0SET = _IEC0_CTIE_MASK;
         /* set interrupt priority */