Yes, it is perfectly polite to close the door when you need privacy. All you have to do is go to the door, say, “Excuse me, I’m going to close the door for a little while now,” and do so.