Celtics struggle, but hold off Bobcats for victory