Officials declared an end to the backup of ships at Southern California’s ports more than two years after vessels began lining up in weekslong queues that became one of the most visible signs in the U.S. of the pandemic-driven turmoil in supply chains.