Magnetization curling in a finite cylinder