Microsoft to lay off 5 percent of total workforce