Send bytea in the correct format in all cases

I failed to spot this case in 6a22d6803c4697d6177a54c379f8d3de56,
which means that we don't have automated tests for that case.  Add
them as well.