common: Adding compress() function

This compress function could be used to determine what's the best
compressor available between pigz & gzip.

That make it more portable.