few remaining fixes for python3 compatibility

Hi,

I've fixed a few of your complaints, like self._expiry. But most notably, I've kicked the bio_new_filename and used file descriptor based approach. Errors in test_bio_file was caused by incorrect test, which have leaked file descriptors. Already updated TODO to reflect what is still needs to do.