[Tizen] Check if stream was opened with correct mode

This patch adds checks whether stream was opened with correct
mode before read or write operation is performed.
Merge pull request #284 from alexshalamov/check_stream_mode

[Tizen] Check if stream was opened with correct mode