[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'.