[Tizen] Raise exception when 'mode' parameter is invalid

According to specification, whether mode is invalid, exception
should be raised. If mode is null or undefined, mode defaults to
'rw'.
Merge pull request #281 from alexshalamov/raise_exception_on_invalid_mode

[Tizen] Raise exception when 'mode' parameter is invalid