Huge coastal barriers could protect the world’s cities. But they’ll have unexpected costs. Pacifica, California, just south of San Francisco, is…