Fix IllegalStateException for fragment transaction commit.