Two people were in custody after the shooting at Australia’s best-known beach during a Jewish event. The authorities advised people nearby to take shelter.