Fix #28: BufferCache::compact too expensive

Remove the vector::erase and only clear the buffer allocation. Requires
keeping track of allocated commands. Refactor code to use atomic ssize_t
for size variables (was a_int32_t).