Check if fragment transaction is empty before attempting to remove it

Change-Id: I08591c89559d33fee30ac2934fdbcc30637147da