use lager_format:format/4 if available

riak_err is no longer packaged with Riak, so use lager to perform truncation instead.