Import pidfile stuff to avoid portability issues