UAE beat Bahrain to reach Gulf Cup semi-final