don't decode and encode object if codecs are the same

Link: https://github.com/GeneAssembly/biosal/issues/525
Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>