Include <stdint.h> before using uintptr_t.

Pointed out by Iain Morgan on pkgsrc-users as causing a build failure
on Linux.
Copy relevant 5 PLIST-mangling lines from extension.mk,
so the bulk builds are hopefully happy again.