email: prevent NPE caused by null cursors

Change-Id: If819f14d4cf25d6ba35110a7a22125909a6f87dc
JIRA: CYAN-4577
Issue: https://jira.cyanogenmod.org/browse/CYAN-4577
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
UnifiedEmail: Update for TRDS Theme

credits to kroz

Change-Id: If02cbfb6ff9e4671fc5f3ddfdbf61dab70e09ac3