small fixes to ec2 adaptor, better example code

The EC2 example code (examples/resource/ec2.py) has no extensive comments, a help message, and actuelly performs kinds sensible operations.
more comments
disciplining threads
fixed threading issue
fixes #152
documentation fix, closes #157
simple  fix for default shell prompt
remove debug output from tests
geneous sprinkling of thread locks over pty* will give the impression of thread safey, and simplifies adaptors.

close #162 -- but will still require syncronization of I/O on adaptor level, at least for async ops.
add debug messages for pty allocation / deallocation, to debug #137 and #147
addresses #160 and #159
change prompt detection heuristics for pty_shell

This is a relatively major change to the pty_shell class which closes #133.  It
introduces a new heuristics for shell prompt detection which is more robust
against strange custom prompts and faulty shell startups.

For low latency links, this heuristics will introduce some additional latency --
for high latency links that should be negligible, and should actually save one
roundtrip in the default case (when the default prompt pattern matches nicely).
Since SAGA targets predominantly high-latency links, this seems acceptable.

Alas, the heuristics will lead to some (non-fatal) ugliness for sftp and scp
connection setup, but for the sake of code simplicity we'll let that slide
(unless it turns out to be a real problem).

This has been tested with bash and tcsh over fork and ssh, with standard and
intentionally broken prompts, but it deserves more testing for robustness before
being released into the wild.
updated mandelbrot example
temporarily disable job state purging
Resolving conflicts from merge
A

Conflicts:
	saga/utils/misc.py
	saga/utils/pty_process.py
	saga/utils/pty_shell.py
	saga/utils/pty_shell_factory.py
trigger jenkins
trigger jenkins
force debug logs.  Hello Mr. Jenkins!
hey Jenkins, how do you like this fix?
pty is too quick to send shell input -- remove superflous prompt trigger

This closes #166