Fix signal handling on Django >= 1.6