config: Refactor the check for the lid special-case out

This also fixes the case where current_is_for_laptop_lid wasn't properly
set in the default case.
config: Fix the memory and other management for MetaMonitorConfig

The code in MetaMonitorConfig was really complex and was trying to do
way too much, using multiple different variables to determine where
things were stored, and trying to do fancy tricks to transfer
ownership.

Add a refcounting system to help simplify this, and clean up the logic.
Simply along the way, this fixes multiple bugs in the monitor config
logic, most notably bug #734889, which was my original goal to fix.
config: Rename ret to config

We don't return this configuration, so don't name it ret.
config: Fix a few memory leaks

We were forgetting to unref in a few places.
Merge pull request #23 from endlessm/shell/3378

Shell/3378