The depletion of gas in high-redshift dwarf galaxies from an inhomogeneous reionization