avoid the second call of time_stamp in handler_fire_timed

When a handler is fired the second expensive call of time_stamp() is
needless. Better use 'cached' value.
let compiler inline time_elapsed
SCRAM-SHA-1 implementation
fixed memory leaks and buffer overflows
little refactoring of SCRAM implementation