Fixed execute_safe. If an error occurs $result  will contain 'code' field instead 'errno'