Function to delete a message.