disown process from terminal

(this is a fix which was done in python3 branch already but not in master yet)