memory: fix exception while trimming

 * We get a NullPointerException when we try to trim,
   it still would be successfull, but thats not how it should work.

 * Now send the correct message to the progressHandler and bail out
   if we get to 100%, also if any error occurres in this thread
   make a proper error warning in logcat.

Thanks to @tejus for this bug report.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>