Kfsio lib: handle mostly theoretical case where crypto key write takes longer than the key generation period by introducing write in progress flag.
Kfsio library: fix crypto keys write error return code by copying errno value immediately after stream close.