pipe raii wrapper

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jollamobile.com>