Thinking of taking a gap year? Here’s how to mitigate the negative consequences when you return to work.