Write extension code to filtered output stream.

Signed-off-by: David ‘Bombe’ Roden <bombe@pterodactylus.net>
Add test case for missing extension code in JPEG files.
Merge pull request #206 from Bombe/fix-jpeg-filter-extensions

Fix jpeg filter extensions