Avoid calling BZ2_bzcompress after it has said that it's done. Fixes #2411. ([62952] is also necessary to make the test case from the ticket work.)