Fix possible fragment NPEs

Check if fragment is attached before trying to indicate if it is refreshing

Change-Id: I5196406a4cdf05f932914447a677a1d6fdc1bbdf