Better (more generic) handling of fetching the binary log "position" (filename, offset).

This also eliminate a bug where we can return the binary log position in the middle of a transaction and hence miss transactional boundaries if we restart the application then.