cec: fix background polling and libcec exit