Fix non-array join statements

If a join is given as string (eg a join of a select statement) php evaluates
isset($queryData['joins'][0]['alias']) incorrect to true.  The fix checks if
$queryData['joins'][0] is set and is an array before checking the array key
'alias'.