Long-term U.S. mortgage rates rose for the sixth straight week to a nearly four-year high, a response to signs of rising inflation.