Bug 987931 - [email] cronsync's self-close races an IndexedDB commit. r=mcav, r=jrburke, r=asuth

land https://github.com/mozilla-b2g/gaia-email-libs-and-more/pull/326
which was reviewed by mcav so r=mcav

this patch also includes:
- secret debug menu updates, r=jrburke
- a fix by jrburke to defer header slice creation until needed,
  avoiding cronsync from creating a wasteful slice.  this part is r=asuth