Refactor monitor_reconfigure to stop using system("xrandr").

This removes the blinking on monitor plug/unplug.
This also avoids crashes we get on intel because of vsync bugs.

Change-Id: I04ad539a66ba7db1786a4c5d0d4eb7638e99cdd1

TEST=Plug in a second screen, check that things display on the external screen. Unplug the screen, check that things come back on the internal lcd.

Review URL:
5 files changed