Avoid continuing when RS has no sensible shard.

Since RS has a different arg parser than most other services, a
difference slipped in: when the shard was not specified and could not
be autodetected, RS did not exit immediately.

Added also a check that the specified shard is in the configuration,
and some unit tests.