Fix crash when replying and thread fragment is not attached. Fix fragment startActivityForResult so that it conforms to Google specs.