Avoid no-op media deletes
Avoid no-op media deletes

If there are no media entries to delete,
avoid creating transactions, prepared statements
and unnecessary log entries.

Signed-off-by: Slavi Pantaleev <0ae70460241c8f04348f26c87a209f8c059b6cd1@devture.com>

matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse