Fixes #4791: Use gzip to compress inventories if possible before transfe...

...r

Ticket: http://www.rudder-project.org/redmine/issues/4791

To be merged in master