rtrim instead of trim for comparing DOCUMENT_ROOT to __DIR__

Using full trim removes any leading DIRECTORY_SEPARATOR as well.
Only want to remove an ending DIRECTORY_SEPARATOR.