Add spec for opening file with text mode
Allow t modifier in file modes

Used in nokogiri's extconf.rb for when developing on the extension
itself.