MB-11305 fix leak of cmdline from engine_testapp

As identified by clang static analyser; {cmdline} was not previously
freed if main() exited during any of the parameter checks. Fix by
moving the check for cmdline to the end; and then freeing there.

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