Python 3 compatitbility

I have to make these changes to get openmm to work with python 3. I think these changes will break under python2, so this isn't for merging but rather to highlight the issue. 
I would suggest against this.  Just take out the `1`.  Unbuffered text files were removed in Python 3 (opening in binary mode still works).  The appropriate solution is to just flush after every write, which I think `StateDataReporter` does already. (I think this might have been code that I added way back when... at least it looks like code I used to write before I started caring about Python 3 compatibility).