integrity/m2v2: fixes for orphan chunk check.

 - use long timeout (1h) for all requests to m2v2 and m2v1
 - stop the check if a network error is encountered
 - handle more cases of chunkid starting with '/'
 - change check order: chunk referencing is checked before chunk date,
   so a referenced chunk cannot be moved to lost+found

Change-Id: I57f0c7b237fe1aa852f876e72d029f00e4aaef8e
integrity: add chunk id check + fix chunk lookup in dupli

 - the new chunk id check tries to convert chunk.id attr to binary and
   on failure replaces the attr by the filename.

 - the chunk lookup used to be achieved by searching for chunk position
   which could lead to a wrong chunk being used in duplicated contexts
   (in which several potential chunks have the same position). Now the
   chunk to be used is found by looking for a chunk with the same id or
   same hash if not found. If both failed, the old way based on
   positions is used.

Change-Id: Ib0a4cc2811a63784124f7f22a99b88fb5b6430d5
Merge changes Ib0a4cc28,I57f0c7b2

* changes:
  integrity: add chunk id check + fix chunk lookup in dupli
  integrity/m2v2: fixes for orphan chunk check.
rainx: fix multithreading

Code is still ugly, but works in multithreaded apache.
Better handling of rawx errors.

Change-Id: Iaad662004ad9bd7f227d5120f9de261117d5179a
rainx: fix cpu leak in rawx stat system

Thanks to Rémi's work on rawx.

Change-Id: Ibce0fd1a106864a2d3ed6ba03655cdbbf1be3b23
Merge changes Ibce0fd1a,Iaad66200

* changes:
  rainx: fix cpu leak in rawx stat system
  rainx: fix multithreading
service_info unique key getter.

First step of the plan toward services identified with a logical ID, instead of an IP:PORT couple.

Change-Id: Iebd9484e53d20877ee5a16192d78e1feeba30dac
http: Useless  unused struct fields removed.

Change-Id: Ib0565ecf84a4682570f31ea7a12726567eff0904
Finer gauges for active threads, reliable accesslog delays

This patch provides the maximum number of active threads, and a round-robin storage for that information.
The granularity proposed is intervals of 1s over the past 30s, and intervals of 1 minute over the past 1 hour.
This data is used by the core server library to expose statistics, e.g.

	server.thread.max.1 = 0
	server.thread.max.5 = 1
	server.thread.max.15 = 2
	server.thread.max.30 = 2
	server.thread.max.60 = 3
	server.thread.max.300 = 3
	server.thread.max.900 = 3
	server.thread.max.3600 = 3

This patch also alters the accesslog format for gridd transports, and it is now unified with http transport.
An access log record now provides 2 treatment durations:
- the total time spent since the reception of the last buffer that completes the request
- the total treatment time, from the moment where a worker thread starts the request handling til the moment an answer is generated.
The delta between both delays is the time spent in the internals queues of the process.

The patch divides in:
- server/stats_holder.* :
  - drops the adherence to system time, the current timestamp is now received from the caller. This is necessary to manager counter with a granularity different than 1s.
  - New calls to compute the cumulative maximum
  - code simplification
- server/network_server.* :
  - new round-robin stats now managed
  - new stats exposed.
  - precise monotonic clock used on the last input
- server/transport_http.c :
  - useless variables removed.
  - accesslog format reviewed (timers printed : total time spent, time spent in queue)
- server/transport_gridd.c :
  - accesslog format reviewed (timers printed : total time spent, time spent in queue)
- sqlx/sqlx_service.c :
  - code adapted to match the lost "time adherence"

Change-Id: I248ae7a1937860e4062290e95b68465d7ec62821
Merge "service_info unique key getter."
Storage policy cleaned, storage class explicit loading

Now able to load a storage class explicitely, out of any storage policy context. This is necessary for the metacd-http to process load-balancing requests with stgclass constraints. In facts, the metacd_http simply wraps the calls to metautils/lib/lb.h API.

A corner case has been managed, when a storage class exists but must not have fallbacks. It was necessary to declare the storage class with an empty configuration.

Then, the code has been cleaned, simplified and reordered by purpose.

Change-Id: Ibd66594d53666f5ca4d1fab6d4226e1dc17ba95d
Merge "Storage policy cleaned, storage class explicit loading"
Load-balancing cleanup.

The starting point of this patch was allowing a caller (i.e. the metacd_http) to use an iterator different than those specified in the NS configuration. In other words, to thinly wrap the API.

Some code reorganisation took place:
  - function reordering (to be grouped by puposes)
  - obsoletes removals (scored iterators ... meaningless since the score is the weight).
  - functions moved in others modules (checks on the storage class of services, moved into service_info)
  - code factorized (minor container handling, in metautils_containers)

Change-Id: I625fd9413e0fa01d68d085f93160c026b9744c0f