qga: Fix buffer size and reorder QDECREF's