Cardinals end season with 23-20 loss to 49ers