Tesla to lay off 9 percent of workforce