Fix WebRTC over WSS not working

Several fixes for the WebSockets implementation in res/res_http_websocket.c

* Flush the websocket session FILE* as fwrite() may not actually guarantee sending
  the data to the network. If we do not flush, it seems that buffering on the SSL
  socket for outbound messages causes issues

* Refactored ast_websocket_read to take into account that SSL file descriptors
  may be ready to read via fread() but poll() will not actually say so because
  the data was already read from the network buffers and is now in the libc buffers

(closes issue ASTERISK-23099)
(closes issue ASTERISK-21930)
Review: https://reviewboard.asterisk.org/r/3248/
........

Merged revisions 409681 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 409697 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@409831 f38db490-d61c-443f-a65b-d21fe96a405b
Fix res/res_http_websocket.c build failure in 32bit due to incorrect print format for uint64_t

git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@409832 f38db490-d61c-443f-a65b-d21fe96a405b
Corrected cross-platform stat nanosecond code

When nanosecond time resolution was added for identifying config file
changes, it didn't cover all of the myriad of ways that one might obtain
nanosecond time resolution off of struct stat.

Rather than complicate the #if even further figuring out one system from
the next, this patch directly tests for the three struct members I know
about today, and #ifdef's accordingly.

Review: https://reviewboard.asterisk.org/r/3273/
........

Merged revisions 409833 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 409834 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 409835 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@409836 f38db490-d61c-443f-a65b-d21fe96a405b