correctly handle shards that are initializing when querying sys.shards

(cherry picked from commit f34db76706471a04e67c5cc0ad711940b0eeaef8)