Pinterest cut nearly 15% of its workforce and reduced office space in January as it pushes more resources into AI.