Improve process detection

The previous process detection didn't play nicely on Linux, so I've
switched it for something that should work.