Add tests for custom keystore, and fix Selendroid handling

* Add tests for custom keystore functionality
* Fix handling of Selendroid custom keystore by checking if the instrumentation app has been resigned/modified and reinstalling

Resolves #1880.