fix leaking of stdin file descriptors
fix race in process tracker