The shapes of liquid menisci near heterogeneous walls and the effect of line tension on contact angle hysteresis