The MKR issue is well known to me as i have tried a multitude of methods to get around it and identify it.
I hadnt thought of checking the 101 section for MKR issues but glad I did.
My code is on the web IDE here
The MKR is as glitchy as h3ll and I am reasonably sure its not a code issue.
I suspect its an Arduino or Atmel issue. as people are seeing it with a variety of sketches from reading here and the dropout times vary wildly from a couple of hours to a couple of days.
It could I suppose be some sort of buffer issue (best guess)