Replace trap/flock process detection due to weirdness [tracker #1399]