feature #1678: close collectd-client.rb's output

(cherry picked from commit b66c9863707a594ea291ad0e7e93735056f37485)