testsuite: Treat an empty string in needs_status_wrapper as false

Updated according to feedback.

GDB test suite considers [target_info needs_status_wrapper] to be false if
it is unset or have a zero value. The former is achieved by using [target_info
exists needs_status_wrapper]. GCC test suite on the other hand do not use
"exists" but compares to an empty string. This doesn't make difference if
value is unset, as unset value is treated as an empty string, but makes a
difference if value was set to and empty string. In that case if
needs_status_wrapper was set to an empty string, then GCC test suite will
not use status wrapper, but GDB test suite will use it. Dejagnu's own
remote.exp uses a comparison with an empty string. Though for some reason
Dejagnu unlike GCC and GDB test suite doesn't treat a zero as a false.

This patch makes GDB test suite treat an empty string in
needs_status_wrapper the same way as it is done by GCC test suite and
Dejagnu. It also extracts those checks into separate function
'gdb_needs_status_wrapper'.

gdb/testsuite/ChangeLog:

2013-10-22  Anton Kolesov <Anton.Kolesov@synopsys.com>

	* lib/gdb.exp (gdb_needs_status_wrapper): New function.
	* lib/gdb.exp (gdb_compile, gdb_wrapper_init): Replace inline checks for
	needs_status_wrapper value with call to a new function.
	* lib/java.exp (java_init): Ditto.