binwrite should pass write only when options are not empty but don't have a "mode"

This fixes problem when passing "encoding" as an option but don't pass a "mode". 
I added this spec to rubyspec on this commit:

https://github.com/rubyspec/rubyspec/commit/f32725141a63a621b771755dc50ec107db0324d6