Call startForegroundService only when needed

This could reduce RemoteServiceException occurences

See #1197
1 job for !486 with service_start in 3 minutes and 20 seconds (queued for 1 second)
latest detached
Status Job ID Name Coverage
  Build
failed #365759
amd64 debian
continuous-app-build

00:03:20

 
Name Stage Failure
failed
continuous-app-build Build
            > Could not HEAD 'https://dl.bintray.com/videolan/Android/org/codehaus/mojo/animal-sniffer-annotations/1.17/animal-sniffer-annotations-1.17.pom'. Received status code 502 from server: Bad Gateway

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 59s
ERROR: Job failed: exit code 1