Average US long-term mortgage rate ticks up to 6%, ending a three-week slide