fix up nstar to not depend on system's getpwuid()

also add some error-handling and fix up directory creation permissions

Signed-off-by: Simon Leung <leungs@us.ibm.com>