ptr: split out borrowed pointer utilities

The ptr module is intended to be for raw pointers.

Closes #3111
auto merge of #6905 : thestinger/rust/ptr, r=catamorphism

The ptr module is intended to be for raw pointers.

Closes #3111