Role of oxygen vacancies formed between top electrodes and epitaxial NiO films in bipolar resistance switching