Fixed flakiness in tests using the scheduler library.
Fixed flakiness in tests using the scheduler library.

This change fixes the tests using the scheduler library by
explicitly invoking `stop()` from the testing interface. This
ensures that no further callbacks are delivered to the scheduler.

For one-off async callbacks that are already on the libprocess queue
we need to do a `Clock::settle` to ensure they are executed before
the mock object goes out of scope.

Review: https://reviews.apache.org/r/44275/

dforsyth/mesos,dforsyth/mesos,andschwa/mesos,chhsia0/mesos,neilconway/mesos,reneploetz/mesos,Gilbert88/mesos,Aman-Jain-14/customizedMesos,verizonlabs/mesos,yuquanshan/customizedMesos,Aman-Jain-14/customizedMesos,reneploetz/mesos,andschwa/mesos,neilconway/mesos,craimbert/mesos,kaysoky/mesos,neilconway/mesos,asamerh4/mesos,verizonlabs/mesos,kaysoky/mesos,gsantovena/mesos,jpeach/mesos,andschwa/mesos,yuquanshan/customizedMesos,reneploetz/mesos,Gilbert88/mesos,abudnik/mesos,craimbert/mesos,asamerh4/mesos,jpeach/mesos,yuquanshan/customizedMesos,gsantovena/mesos,asamerh4/mesos,neilconway/mesos,gsantovena/mesos,zmalik/mesos,Gilbert88/mesos,zmalik/mesos,gsantovena/mesos,verizonlabs/mesos,kaysoky/mesos,kaysoky/mesos,craimbert/mesos,neilconway/mesos,asamerh4/mesos,craimbert/mesos,abudnik/mesos,zmalik/mesos,jpeach/mesos,andschwa/mesos,yuquanshan/customizedMesos,asamerh4/mesos,dforsyth/mesos,yuquanshan/customizedMesos,kaysoky/mesos,zmalik/mesos,chhsia0/mesos,Aman-Jain-14/customizedMesos,craimbert/mesos,neilconway/mesos,verizonlabs/mesos,abudnik/mesos,andschwa/mesos,gsantovena/mesos,Aman-Jain-14/customizedMesos,reneploetz/mesos,reneploetz/mesos,kaysoky/mesos,abudnik/mesos,jpeach/mesos,jpeach/mesos,Gilbert88/mesos,gsantovena/mesos,yuquanshan/customizedMesos,abudnik/mesos,andschwa/mesos,verizonlabs/mesos,Aman-Jain-14/customizedMesos,zmalik/mesos,craimbert/mesos,craimbert/mesos,kaysoky/mesos,gsantovena/mesos,Gilbert88/mesos,dforsyth/mesos,zmalik/mesos,asamerh4/mesos,dforsyth/mesos,chhsia0/mesos,reneploetz/mesos,zmalik/mesos,chhsia0/mesos,Gilbert88/mesos,dforsyth/mesos,chhsia0/mesos,verizonlabs/mesos,andschwa/mesos,abudnik/mesos,Gilbert88/mesos,Aman-Jain-14/customizedMesos,chhsia0/mesos,asamerh4/mesos,jpeach/mesos,neilconway/mesos,verizonlabs/mesos,reneploetz/mesos,Aman-Jain-14/customizedMesos,abudnik/mesos,jpeach/mesos,chhsia0/mesos,yuquanshan/customizedMesos,dforsyth/mesos