Merge pull request #15 from martyone/next

Fix MER#769, MER#814 and more
Mer: Properly check if VM is running headless on exit

Signed-off-by: Martin Kampas <martin.kampas@jolla.com>