Added tests for getopt

Change-Id: I1e565ef91186fa86d5f6f4c9c82fbce22a8110c0
Reviewed-on: http://review.couchbase.org/32317
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>