Global stock markets mostly gained on Thursday, as the British public went to the polls to vote on whether to remain in or leave the European Union.