A systematic error in the determination of dislocation densities in thin films