A Saudi security officer and a Yemeni soldier have been killed in attacks on a border post between the two countries.