[PATCH] fork: fix race in setting child's pgrp and tty