Ported r2585 from ZXing

Original commit message: "Avoid stack overflow in some odd case in
multiple barcode detection, and don't use multiple threads for one image
on the command line"
Ported r2586 from ZXing

Original commit message: "Make sure strings with a space aren't
considered a URI"