Record closed-by if opening a ticket with state closed

Fixes #1531