x86/alternatives: Make optimize_nops() interrupt safe and synced