Fix buffer overflow in get characteristic callback

We are copying characteristic data before we have this space allocated.