fix randstring bug
getAbsolutePath() moved into utils.c
pathIsBaseName() added to utils.c

The function is used to test that the specified string looks like just
as the basename of a path, without any absolute or relative path.
Only allow basenames for dbfilename and appendfilename.

This fixes issue #1094.
Merge pull request #776 from charsyam/ziplist-bug

fix randstring bug in ziplist.c
pqsort.c: remove the "switch to insertion sort" optimization.

It causes catastrophic performance for certain inputs.

Relevant NetBSD commit:

http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdlib/qsort.c?rev=1.20&content-type=text/x-cvsweb-markup&only_with_tag=MAIN

This fixes issue #968.