API for detaching from the controlling terminal