python extended prompt: Use os.getcwd() instead of os.getcwdu()

It seems like using os.getcwdu() here is wrong both for Python 2 and Python 3.

For Python 2, this returns a 'unicode' object, which tries to get concatenated
to a 'str' object in substitute_prompt. The implicit conversion works when the
unicode string contains no accent. When it does contain an accent though,
displaying the prompt results in the following error:

(gdb) set extended-prompt \w
...
  File "/home/simark/build/binutils-gdb-python2/gdb/data-directory/python/gdb/prompt.py", line 138, in substitute_prompt
    result += str(cmd(arg))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 49: ordinal not in range(128)

When using os.getcwd() instead, it just works correctly.

For Python 3, this method simply does not exist. It works fine with os.getcwd().

gdb/ChangeLog:

	* python/lib/gdb/prompt.py (_prompt_pwd): Use os.getcwd() instead of
	os.getcwdu().
Fix Python help() test for Python 3

The message displayed when using help() changed a bit with time, so this
adjusts the test accordingly.

gdb/testsuite/ChangeLog:

	* gdb.python/python.exp: Change expected reply to help().
Fix prints in tests for Python 3

Python 3's print requires to use parentheses, so this patch adds them where
they were missing.

gdb/testsuite/ChangeLog:

	* gdb.python/py-linetable.exp: Add parentheses to calls to print.
	* gdb.python/py-type.exp: Same.
	* gdb.python/py-value-cc.exp: Same.
	* gdb.python/py-value.exp: Same.
Fix build with Python 3.4 (PR python/16784)

The type of the function pointer PyOS_ReadlineFunctionPointer (part of the
Python C API), which we use, slightly changed starting with Python 3.4. The
signature when from

PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *);

to

PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);

The parameter that changed is the prompt text.

This commits adjust gdb accordingly by making the prompt_arg parameter const,
as well as the fallouts of that. I needed to rework how annotations are added
to the prompt, since the it is now const. If annotations are enabled, it will
make a copy of the prompt and then overwrite prompt_arg to point to the
annotated prompt. Otherwise, no copy is done and the original prompt_arg is
passed.

I changed the signature of deprecated_readline_hook. I would've changed any
user of it, but it seems like nothing is using it,

Built-tested with python 2.7.x, 3.3.y and 3.4.z.

Signed-off-by: Simon Marchi <simon.marchi@ericsson.com>