Fix missing imports (#542)
Adapt niceness detection for psutil < 2.0