fix soft reboot while formatting

While formatting it's possible to cause a framework crash if the format
opperation is not successful. The 'getCode' function in 
NativeDaemonConnectorException can cause a NullPointerException, since 
'mEvent' can be null. If an exception is thrown while formatting the 
thread will try to create a Toast to notify the user of failure. This 
causes a RuntimeException because a Toast cannot be shown from a 
background thread. Make sure 'getCode' will not throw a 
NullPointerException and also create a handler so that the thread can 
send a message in order to create a Toast.

Change-Id: I04c250c46509ae38b0d0a5bfc0e950efbad58305