overlord/standby: fix possible deadlock in standby test
A deadlock was observed in the tests, and a timeout was eventually hit.
Relevant backtrace:
```
=== RUN Test
SIGQUIT: quit
PC=0x45be81 m=0 sigcode=0
...
goroutine 5 [chan receive]:
github.com/snapcore/snapd/vendor/gopkg.in/check%2ev1.(*suiteRunner).runTest(0xc4200ac200, 0xc4200a3e30, 0xc4200c4960)
/<<BUILDDIR>>/snapd-2.43+git1625.7e2fbf5~ubuntu19.04.1/_build/src/github.com/snapcore/snapd/vendor/gopkg.in/check.v1/check.go:819 +0x55
github.com/snapcore/snapd/vendor/gopkg.in/check%2ev1.(*suiteRunner).run(0xc4200ac200, 0xc420024730)
/<<BUILDDIR>>/snapd-2.43+git1625.7e2fbf5~ubuntu19.04.1/_build/src/github.com/snapcore/snapd/vendor/gopkg.in/check.v1/check.go:624 +0xf2
github.com/snapcore/snapd/vendor/gopkg.in/check%2ev1.Run(0x5e8660, 0xc420024730, 0xc420066c00, 0x0)
/<<BUILDDIR>>/snapd-2.43+git1625.7e2fbf5~ubuntu19.04.1/_build/src/github.com/snapcore/snapd/vendor/gopkg.in/check.v1/run.go:92 +0x4d
github.com/snapcore/snapd/vendor/gopkg.in/check%2ev1.RunAll(0xc420066c00, 0x0)
/<<BUILDDIR>>/snapd-2.43+git1625.7e2fbf5~ubuntu19.04.1/_build/src/github.com/snapcore/snapd/vendor/gopkg.in/check.v1/run.go:84 +0xa1
github.com/snapcore/snapd/vendor/gopkg.in/check%2ev1.TestingT(0xc4200c40f0)
/<<BUILDDIR>>/snapd-2.43+git1625.7e2fbf5~ubuntu19.04.1/_build/src/github.com/snapcore/snapd/vendor/gopkg.in/check.v1/run.go:72 +0x368
github.com/snapcore/snapd/overlord/standby_test.Test(0xc4200c40f0)
/<<BUILDDIR>>/snapd-2.43+git1625.7e2fbf5~ubuntu19.04.1/_build/src/github.com/snapcore/snapd/overlord/standby/standby_test.go:31 +0x2b
testing.tRunner(0xc4200c40f0, 0x611748)
/usr/lib/go-1.10/src/testing/testing.go:777 +0xd0
created by testing.(*T).Run
/usr/lib/go-1.10/src/testing/testing.go:824 +0x2e0
goroutine 18 [chan receive]:
github.com/snapcore/snapd/overlord/standby.(*StandbyOpinions).Stop(0xc42007e910)
/<<BUILDDIR>>/snapd-2.43+git1625.7e2fbf5~ubuntu19.04.1/_build/src/github.com/snapcore/snapd/overlord/standby/standby.go:115 +0x11a
github.com/snapcore/snapd/overlord/standby_test.(*standbySuite).TestStartChecks(0xc420024730, 0xc4200c4b40)
/<<BUILDDIR>>/snapd-2.43+git1625.7e2fbf5~ubuntu19.04.1/_build/src/github.com/snapcore/snapd/overlord/standby/standby_test.go:149 +0x451
reflect.Value.call(0x5e8660, 0xc420024730, 0x1e13, 0x6054e8, 0x4, 0xc42004df70, 0x1, 0x1, 0x741740, 0x5ff7c0, ...)
/usr/lib/go-1.10/src/reflect/value.go:447 +0x969
reflect.Value.Call(0x5e8660, 0xc420024730, 0x1e13, 0xc420037770, 0x1, 0x1, 0xc4200c4c30, 0xc420037707, 0x1)
/usr/lib/go-1.10/src/reflect/value.go:308 +0xa4
github.com/snapcore/snapd/vendor/gopkg.in/check%2ev1.(*suiteRunner).forkTest.func1(0xc4200c4b40)
/<<BUILDDIR>>/snapd-2.43+git1625.7e2fbf5~ubuntu19.04.1/_build/src/github.com/snapcore/snapd/vendor/gopkg.in/check.v1/check.go:781 +0x575
github.com/snapcore/snapd/vendor/gopkg.in/check%2ev1.(*suiteRunner).forkCall.func1(0xc4200ac200, 0xc4200c4b40, 0xc42000ca00)
/<<BUILDDIR>>/snapd-2.43+git1625.7e2fbf5~ubuntu19.04.1/_build/src/github.com/snapcore/snapd/vendor/gopkg.in/check.v1/check.go:675 +0x7c
created by github.com/snapcore/snapd/vendor/gopkg.in/check%2ev1.(*suiteRunner).forkCall
/<<BUILDDIR>>/snapd-2.43+git1625.7e2fbf5~ubuntu19.04.1/_build/src/github.com/snapcore/snapd/vendor/gopkg.in/check.v1/check.go:672 +0x20c
goroutine 20 [chan receive]:
github.com/snapcore/snapd/overlord/standby_test.(*standbySuite).TestStartChecks.func2(0x0)
/<<BUILDDIR>>/snapd-2.43+git1625.7e2fbf5~ubuntu19.04.1/_build/src/github.com/snapcore/snapd/overlord/standby/standby_test.go:135 +0x39
github.com/snapcore/snapd/overlord/standby_test.opine.CanStandby(0xc4200249d0, 0x740800)
/<<BUILDDIR>>/snapd-2.43+git1625.7e2fbf5~ubuntu19.04.1/_build/src/github.com/snapcore/snapd/overlord/standby/standby_test.go:118 +0x27
github.com/snapcore/snapd/overlord/standby.(*StandbyOpinions).CanStandby(0xc42007e910, 0xf42400)
/<<BUILDDIR>>/snapd-2.43+git1625.7e2fbf5~ubuntu19.04.1/_build/src/github.com/snapcore/snapd/overlord/standby/standby.go:67 +0x213
github.com/snapcore/snapd/overlord/standby.(*StandbyOpinions).Start.func1(0xc42007e910)
/<<BUILDDIR>>/snapd-2.43+git1625.7e2fbf5~ubuntu19.04.1/_build/src/github.com/snapcore/snapd/overlord/standby/standby.go:88 +0x88
created by github.com/snapcore/snapd/overlord/standby.(*StandbyOpinions).Start
/<<BUILDDIR>>/snapd-2.43+git1625.7e2fbf5~ubuntu19.04.1/_build/src/github.com/snapcore/snapd/overlord/standby/standby.go:84 +0x3f
...
*** Test killed with quit: ran too long (10m0s).
FAIL github.com/snapcore/snapd/overlord/standby 600.026s
```
The test code was stuck in StandbyOpinions.Stop(), but the actual standby loop
was blocked receiving from a channel in mocked opine() code.
Tweak the test to improve synchronization.
Signed-off-by: Maciej Borzecki <email address hidden>