Fixed logic error causing IOException if stream supports mark (#10851)

The current logic caused mark() never to be called if the original InputStream supports mark (isMarkSupported()). This in turn causes an IOException when reset is called and no mark has been set.

Change-Id: I781ed8e9d355d22bd8e43acb5c5e9c8da90f66a0