archive: use bufio for compression detection

Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
Merge pull request #5823 from proppy/archive-bufio

archive: use bufio for compression detection