The wave of layoffs in tech, media and elsewhere is affecting a sizable number of people who are out on medical or parental leave. While legal, it can make a bad situation even worse.