Fix ApplicationResourceIntegrationTest

- Accept stopped or “stopped”.
- Not sure if entirely necessary, but suspect might be based on 
  behaviour seen on jenkins for some other tests!
MongoDB deployment integration test: fix assert
MongoDB deployment: fix infinite loop
MongoDB: fix race in adding shards

- if adding the shard fails, then try again
Fix Riak install on Ubuntu
This closes #293