kmod/core: move dynamic relocation writes to new function

Unclutter kpatch_register a little bit.
kmod/core: make loc variable a u64

So less casting is needed.
kmod/core: ensure page is RO before changing its permissions

Make sure we leave the page's execution permissions in the same state we
found them.
Merge pull request #217 from jpoimboe/check-page-rw

kmod/core: ensure page is RO before changing its permissions