x86: Use kmemdup() in copy_thread(), rather than duplicating its implementation