Fix error handling in log slot initialization.

Also an optimization to log buffer grow code.