Safer handling of input buffer
Safer handling of input buffer

This change was suggested via the stackoverflow thread: https://stackoverflow.com/questions/49540585/excessive-cpu-usage-on-golang-stdin-loop - I do not fully understand this but have implemented and it is working for me.  I think it just makes sure that we do not read buffer beyond actual number of bytes (I am still fairly new to go so please use your judgement..).
safchain/ejabberd-go-auth