[HEAD MERGE] Fix close index fd in metadata stream

Signed-off-by: David Goulet <dgoulet@efficios.com>
[MERGE] close metadata write pipe side

Signed-off-by: David Goulet <dgoulet@efficios.com>