Typos.
Fixed memory leak in the function ScanCollectionDirectory(). If the file extension is .db and it is a compaction file, 'filename' is leaked when 'newName' is assigned to it.
In the function TRI_LoadCollectionInfo(), when the value's type is a JSON string and the key is not the 'name', it checked again whether the value's type is a JSON string, instead of comparing the key with 'cid'.
In the function TruncateAndSealDatafile(), 'filename' and 'oldname' were not freed. If TRI_UNMMFile() failed, the file was not closed.
In the function OpenDatafile(), if TRI_Allocate() failed to allocate memory for 'datafile', the file was not unmapped and not closed.
In the function TRI_CreateNodeReturnEmptyAql(), if TRI_Allocate() failed to allocate memory for 'list', 'list' was freed, instead of 'node'.
Memory leak in the function ScanPath() if the directory is not writable.
The 'json' structure was not freed in the function TRI_LoadCollectionInfo() if the file was not a JSON array.
Merge remote branch 'remotes/upstream/devel' into experiment
In the function CheckDatafile(), inside the while loop, there are two consecutive 'if' with the same body and similar condition. The first 'if' has been removed, as its condition is more restrictive than the second.
Merge pull request #519 from guidoreina/experiment

Minor bug fixes.