Fix #340 (Appium Doctor throwing exceptions in version 1.2.0)

Also created `setupServerTask`, which contains the shared setup code for the server task.