msm: smd_tty: Reset the open flag in close operation
The open flag in each SMD tty device is not reset during the close
operation. When the SMD tty device is closed and reopened quickly,
this leads to the completion of open operation even though the
underlying SMD channel is not open completely. Hence the few
initial operations on the SMD tty device fails. The open flag is
reset during the close operation, so that the successive open operation
waits until the underlying SMD channel is open completely.

Change-Id: I6c154a3c0fc9d084d4374c696fe05b8593999cf9
CRs-Fixed: 318810
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
msm: smd_tty: Check the device is open before scheduling tasklets
When the SMD tty device is closed, tasklets to perform read operation
is killed first and then the underlying SMD channel is closed. There
is a race condition where the tasklet gets rescuduled between these
two operations. So ensure that the device is open before scheduling
tasklets to avoid this race condition.

Change-Id: I80c4e1538a69b5b05c1aadb0f4b0905f96a90001
CRs-Fixed: 318764
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>