* fix(kb): clean up KBMedia records on document delete, fix update_kb_stats
- delete_document_by_id now deletes associated KBMedia records before
removing the KBDocument row, preventing orphaned media data.
- update_kb_stats now passes kb_id filter to vec_db.count_documents,
fixing chunk count that previously counted across all KBs.
- add tests for document deletion cleanup and update_kb_stats behavior.
* fix(kb): merge media and document deletion into single transaction