Make PostgresSQLConnection defensively thread safe

Race conditions should be properly caught, but will still throw a
ConnectionStillRunningQueryException.  Basically this just involves making
setQueryPromise check for an existing promise and reordering operations to
happen within this mutex.  readyForQuery is no longer necessary as it is fully
redundant with queryPromise.  For Issue #59.
Make MySQLConnection defensively thread-safe

Use the same approach as in PostgreSQLConnection, where queryPromise is an
AtomicReference.  Previously it would check queryPromise.isComplete.  However,
there was no way that a non-null promise could be complete as the only two
places it was completed (in {succeed,fail}QueryPromise) immediately set it to
null beforehand.  This should be reviewed/tested.  Issue #59.

Updated clearQueryPromise in both to return the old promise, in order to avoid
racing completions.
Minor optimization: use foreach rather than map
Merge pull request #63 from dylex/mutex

Connection mutex improvements for issue #59