This wealthy California city just flirted with bankruptcy to avoid new housing