Jack Dorsey, the founder of Twitter, apologized to former employees after the company’s new owner, Elon Musk, laid off half of its employees.