memory: implement xstp(n)cpy

Both are implemented to POSIX 2008 spec, though I'm not sure I'm happy about
stpncpy's behaviour.