Optimize key-based Hash access for empty hashes

This avoids performing the potentially expensive hash computation in
the event that the Hash is empty, as there cannot possibly be a match.
Conform to MRI behaviour for empty hashes

In the event that the `#hash` method has side effects, any optimisation
with respect to empty hashes will affect the results of the operations.

For MRI, the empty-hash optimisation seems to be applied everywhere in
2.0.0 and beyond. In 1.9.3 the #hash method is not called for #[] and
#key?, but strangely enough the performance is not improved for empty
hashes. In 1.8.7, the #hash method is always called even if empty.

This does not match the semantics of MRI exactly, as this avoids calling
the #hash method from #values_at in 1.9.3, but that would be slightly
more involved to implement.
[Truffle] Call stacks and object space only need slow access to frames.
[Truffle] Add a Truffle fatal exception that we never try to handle for complicated cases like exceptions when creating a call stack.
[Truffle] Make backtraces a little bit more robust.
[Truffle] Give backtraces a hash syntax for locals, and add options for how it's printed.
[Truffle] Add self to backtrace.
Merge pull request #1676 from grddev/empty-hash-optimization

Empty hash optimization
Merge with jruby-1_7
[trivial] Make single-line ifs and make getEntry read as !18
Merge with jruby1-_7
[Truffle] Backtrace fixes.
Merge branch 'master' of jruby.org:jruby
options-1.2 has propagated.
Merge remote-tracking branch 'origin/jruby-1_7'

Conflicts:
	core/pom.xml
Revert "added directory listing info the jruby-stdlib.jar so ClasspathResource and URLResource"

This reverts commit c04c50f67ae8c80d52d86ee74100a063bb036c2b.
Handle CancelledKeyException in IO.select

When a CancelledKeyException is raised in IO.select/SelectBlob#processSelectedKeys it caught, but the catch block causes another one to be raised immediately. This patch removes the catch block completely (because it's never run, so nothing can rely on what it does) and raises an Errno::EBADF from SelectBlob#goForIt.

CancelledKeyException is raised when the underlying channel has closed, which is normally handled. There is however a race condition in the channel selection that means that you can get a cancelled key from select if the channel is closed just after the selector determines that it is ready to read or write.

It's unclear what the correct way of handling this really is, but raising EBADF feels reasonable, the channel has been closed and so it's no longer a valid file descriptor.

This closes #1580
Raise Errno::EBADF for some IOExceptions

AbstractSelectableChannel#configureBlocking can raise IOExceptions with the message "Bad file descriptor", this happens for example in SelectBlob#registerSelect under some circumstances. This patch translates these IOExceptions to Errno::EBADF instead of IOError as they are now.
Merge remote-tracking branch 'origin/jruby-1_7'

Conflicts:
	core/src/main/java/org/jruby/Ruby.java
	core/src/main/java/org/jruby/util/ClasspathResource.java
	core/src/main/java/org/jruby/util/URLResource.java
	maven/jruby-stdlib/pom.xml
fix minor indentation issues