The man eventually surrendered to San Leandro Police Department officers after throwing his handgun at a cruiser