Former Stormont official Sue Gray has resigned as Sir Keir Starmer’s chief of staff because of fears she was “becoming a distraction”.