Fixed a bug with Ruby 1.8 and how StringIO#path.

It was assumed that IO objects responding to `#path` could be
given to `File.size`.  This is incorrect for Ruby 1.8.7, where
`StringIO` responds to `#path`, returning `nil`.

This check has been expanded to responds to path and path not nil.