linux: refactor bsd_to_linux_regset() out of linux_ptrace.c
This will be used for Linux coredump support.
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D30365
(cherry picked from commit 95c19e1d65619624db4a7a21afc1685f122a05c1)