Clear all old flags, even if we change the gc mode during the major gc.

This patch was tested by @akiray03. Thanks a lot!