Add _cleanup_pclose_ and fix mismatching pipe close opened by popen()

Based-on-patch-by: Thomas Jarosch <thomas.jarosch@intra2net.com>

cppcheck reported:
[src/bootchart/svg.c:791]: (error) Mismatching allocation and deallocation: f
tmpfiles: introduce type X

Type X will exclude path itself from clean-up. However, if the path is a
directory systemd-tmpfiles will clean-up its content.

In contrast to type x, where path is ignored completely, type X needs some
Age parameter. In order to determine Age parameter, we will look for config
entries of type d or D and pick the best match.  Best match is either
exact match or longest prefix match.
tmpfiles: exclude /tmp/systemd-private-* from cleanup

See http://thread.gmane.org/gmane.comp.sysutils.systemd.devel/6874/focus=6891
Should fix https://bugzilla.redhat.com/show_bug.cgi?id=866693