Encapsulate the code dealing with requesting an inhibitor lock in a
dedicated Inhibitor class. The lock is acquired in the constructor and
released in the destructor.
The constructor first tries to acquire the lock using the modern
"org.freedesktop.login1.Manager" interface, then tries the previous
"org.freedesktop.PowerManagement.Inhibit" interface as a fallback.