Pinned fluxons in a Josephson junction with a finite-length inhomogeneity