49ers extend defensive anchor Justin Smith