Bug 901820 - Part 3. comm-cetral part of replacing nsCRT::strdup. r=Neil, a=jcranmer