utils: add a function for checking if a process given by pid is still alive