Three-dimensional particle-in-cell simulation study of a relativistic magnetron