Fix inifinite loop occuring in proc fork()