Make CustomPrintOptionsTest more reliable

- If we have several writes make sure to wait for the last one
- make sure discovery session is gone to isolate tests from each other.
- Instead of using UI operations (e.g. pressBack) use more reliable API
  operations
- Include more UI interaction under try-loop's to handle the UI elements
  not yet being loaded

Bug: 27861927
Change-Id: I5d059109e41b7e36721c20a9cd71e20734d1c10b
10 files changed