Thousands of people attended a funeral prayer service for the three men killed by gunmen at a mosque in San Diego on Monday.