Add automatic ref infrastructure for native impl and other usages
XNIO-208 Add writeFinal and sendFinal method to channels

This allows for optimisation of protocols that require writing
termination data, such as HTTP chunking.