fix double free error and sigfault error in multi-display support

Signed-off-by: Mattias Andrée <maandree@operamail.com>