Lock when calling Console::stop_threads().
Lock when calling Console::stop_threads().

When calling this method (e.g. when forking) there would be a very small time
frame where a read() call in FSEvent could be called _before_ the exit-request
status was set. This would result in a console thread hanging forever in a
read() call as everything else was already shut down (by the looks of it).

The solution here is to lock before we set the status and perform any cleanup
tasks.

This fixes #3121 #3129.

Azizou/rubinius,benlovell/rubinius,jemc/rubinius,jsyeo/rubinius,digitalextremist/rubinius,sferik/rubinius,kachick/rubinius,Wirachmat/rubinius,kachick/rubinius,Azizou/rubinius,Wirachmat/rubinius,mlarraz/rubinius,Azizou/rubinius,sferik/rubinius,kachick/rubinius,dblock/rubinius,benlovell/rubinius,digitalextremist/rubinius,heftig/rubinius,dblock/rubinius,ruipserra/rubinius,Wirachmat/rubinius,mlarraz/rubinius,benlovell/rubinius,mlarraz/rubinius,kachick/rubinius,ruipserra/rubinius,dblock/rubinius,benlovell/rubinius,Wirachmat/rubinius,ruipserra/rubinius,dblock/rubinius,mlarraz/rubinius,mlarraz/rubinius,jemc/rubinius,sferik/rubinius,ngpestelos/rubinius,digitalextremist/rubinius,sferik/rubinius,Azizou/rubinius,sferik/rubinius,jemc/rubinius,jsyeo/rubinius,heftig/rubinius,dblock/rubinius,dblock/rubinius,ruipserra/rubinius,jsyeo/rubinius,ngpestelos/rubinius,ngpestelos/rubinius,digitalextremist/rubinius,digitalextremist/rubinius,heftig/rubinius,Azizou/rubinius,Wirachmat/rubinius,Wirachmat/rubinius,kachick/rubinius,benlovell/rubinius,mlarraz/rubinius,digitalextremist/rubinius,heftig/rubinius,kachick/rubinius,jemc/rubinius,heftig/rubinius,jemc/rubinius,ngpestelos/rubinius,dblock/rubinius,Azizou/rubinius,mlarraz/rubinius,sferik/rubinius,ruipserra/rubinius,jsyeo/rubinius,digitalextremist/rubinius,ruipserra/rubinius,ruipserra/rubinius,ngpestelos/rubinius,ngpestelos/rubinius,ngpestelos/rubinius,kachick/rubinius,Wirachmat/rubinius,jsyeo/rubinius,heftig/rubinius,sferik/rubinius,jemc/rubinius,benlovell/rubinius,jsyeo/rubinius,heftig/rubinius,Azizou/rubinius,jemc/rubinius,kachick/rubinius,jsyeo/rubinius,benlovell/rubinius