The command buffer handle was not reset after being freed on window resize, leading to a segfault when the stale handle was used.
Fixes #1477.