Size-dependent error of the density functional theory ionization potential in vacuum and solution