Fix SMTP RFC violation for better interoperability

Space after colon violates RFC 5321 (and RFC 821): "Since it has been a common
source of errors, it is worth noting that spaces are not permitted on either
side of the colon following FROM in the MAIL command or TO in the RCPT command"

Change-Id: Ie5330bf2bd01cd8f734134dadd742cf16df70d7a
Signed-off-by: Jack Bates <jack@nottheoilrig.com>
Potential NPE in Account.

Also, avoid calling close() if the cursor is already closed.
Signed-off-by: Sylvain Becuwe <sylvain.becuwe@gmail.com>

Merged in AOSP: https://android-review.googlesource.com/#/c/45703/

Change-Id: I5e077a03e437721b8fc7ffb9af284eaa405d901e
email: "Exchange Services has stopped" - Rain of Exchange Javacrashes

Cleanup some nasty records containing NULL fields.

Author: Emmanuel Berthier <emmanuel.berthier@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 60461

Merged in AOSP: https://android-review.googlesource.com/#/c/47571/

Change-Id: Iec5e7e1bebc4beee8fa010c3f9c9ee723fd2cd83
Force close_crash happened when add new mail from Email widget

rootcause: The widget store a email account id when Launcher add a email widget.
If the email account is removed, but the widget acount id is still exsit.

Change-Id: I4b18e19506ed6afe5d24ab44585cd58c37e221f0
Author: Erjun Ding <erjunx.ding@intel.com>
Signed-off-by: Erjun Ding <erjunx.ding@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 36835
Merge remote-tracking branch 'upstream/jb-mr1' into jb-mr1