Arrest of mentally ill, homeless man in California highlights system’s flaws