target: add new methods

Added the following method to targets:

- sleep: sleep on target for the specified duration. In some situations,
         e.g. on simulation platforms, it is important that sleep
	 happens on the target rather than the host.

Added the following methods to Android targets:

- ensure_screen_is_off: complements the existing ensure_screen_is_on.
- homescreen: navigate to home screen.
diff --git a/devlib/target.py b/devlib/target.py
index a7deca2..5bddad4 100644
--- a/devlib/target.py
+++ b/devlib/target.py
@@ -552,6 +552,10 @@
         else:
             raise ValueError('Unknown compression format: {}'.format(ext))
 
+    def sleep(self, duration):
+        timeout = duration + 10
+        self.execute('sleep {}'.format(duration), timeout=timeout)
+
     # internal methods
 
     def _execute_util(self, command, timeout=None, check_exit_code=True, as_root=False):
@@ -1067,6 +1071,13 @@
         if not self.is_screen_on():
             self.execute('input keyevent 26')
 
+    def ensure_screen_is_off(self):
+        if self.is_screen_on():
+            self.execute('input keyevent 26')
+
+    def homescreen(self):
+        self.execute('am start -a android.intent.action.MAIN -c android.intent.category.HOME')
+
     def _resolve_paths(self):
         if self.working_directory is None:
             self.working_directory = '/data/local/tmp/devlib-target'