Local simulations of the magnetized Kelvin-Helmholtz instability in neutron-star mergers