Caldwell, James A., Confederate soldier