x86: Unify copy_to_user() and add size checking to it