extracted writeBytesToHdfs to protected

this allows for us to extend the class (which i'm trying to do and makes
it hard with things being private)
refactored a bit more

must handle synchronization on own.