MDL-37046 behat: Changes from integration review

* RTL languages problem solved
* Fixed curl errno return
* Switch to behat test environment code more readable