Use g_autoptr in inhibitor lock code

Instead of doing manual memory management, use g_autoptr, because
it doing it manually is error prone.
Also use g_autoptr for the GError "error" and the GUnixFDList "fds"
which both were leaked before.
1 job for master in 2 minutes and 53 seconds (queued for 2 seconds)