Fixed crash when fragment is detached from Activity.

Bug: 64493
Change-Id: I214f801f92520ffedad0aafa3c15d2aa5e1524f5
Merge "Fixed crash when fragment is detached from Activity."