CMFileManager: Check write operation

Check that write operation writes exactly the expected bytes to the backend filesystem.
Otherway, retry the write operation.

Change-Id: I4c2267a76b4190edcc3edba2836124a4651708ea
JIRA: CYAN-2129
Issue: https://jira.cyanogenmod.org/browse/CYAN-2129
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>