Fix segfault when using custom window borders