Days before she is set to formally start Britain’s exit from the European Union, Mrs. May will have to juggle the fallout of the deadly attack Wednesday at the heart of the government as she guides the nation through a historic transformation.