It is brought in the poskim from the Sefer Hazohar that one should not walk four amos (6.31 feet) before washing his hands, unless it is needed, because another ruach hatumah will then come on the person. Because of this, some have the minhag to prepare water near their bed to wash their hands before they walk. However, the general minhag is to be lenient based on what the Vilna Goan said after the Ger Tzedek of Vilna was burnt. He said that because of this tremendous Kiddush Hashem, a fire left the Meoras Hamachpela and burnt the ruach hatumah of walking four amos before washing your hands. Nevertheless the ruach hatumah of when a person sleeps is still around, and therefore one should wash their hands as soon as possible to lessen the time that it is on you.