Khosla must open beach-access gate, California court rules