Quit Bitmask if there is no polkit agent running.

Closes #6150.