stats: Check for errors from copyout()
This is in preparation for annotating copyin() and related functions
with __result_use_check.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43179
(cherry picked from commit a0993376ec5f979272a62b140ec9f41bc02107b3)