Fix JSON monkey patch for StringIO-like objects

Reads all objects with a StringIO-like interface,
not only StringIO itself. One use-case being
Unicorn::TeeInput, but others may exist.

Change-Id: I9dee666d7d1161853b933cfa164d5edf671c6fe8
Reviewed-on: http://review.couchbase.org/26760
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>