I agree that it wasn't inappropriate at all. I bet the other mourners didn't even notice.

I'm sorry for your loss.