Man arrested in SF library attack