This patch fixes the issue #2511(https://github.com/i3/i3/issues/2511).
1). Memorize the marks, but only call con_mark once the container has finished parsing. (Credit: This is @Airblader's patch.)
2). Add a test case 267-regress-mark-restart.t for regression test to check if mark and restart command crash i3.