Merge all other contributions

New features
Fix Windows bugs
"write if pending" can be written in ruby as:

```ruby
_sincedb_write if @sincedb_write_pending
```

Why have it as a separate method?