aio: fix possible invalid memory access when DEBUG is enabled