Added function to provide custom net methods
Initialize address_len before accept()

accept() could produce unexpected behavior in case the address_len is
uninitialized, e.g. return -1 with EINVAL
README: update instructions for MacPorts
tgl.h: add stdlib.h include

This fixes the error

```
gcc -I. -I. -I/usr/local/include -I/opt/local/include -I/opt/local/include/lua-5.1  -I/usr/local/include -I/usr/include -I/usr/include  -I/opt/local/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF ./dep/lua-tg.d -MQ ./objs/lua-tg.o -o objs/lua-tg.o lua-tg.c
In file included from lua-tg.c:25:
In file included from ./lua-tg.h:24:
./tgl.h:380:27: error: implicitly declaring library function 'malloc' with type
      'void *(unsigned long)' [-Werror]
  struct tgl_state *TLS = malloc (sizeof (*TLS));
                          ^
./tgl.h:380:27: note: please include the header <stdlib.h> or explicitly provide
      a declaration for 'malloc'
1 error generated.
make: *** [objs/lua-tg.o] Error 1
```
Merge pull request #301 from xypiie/master

Initialize address_len before accept()
Merge pull request #305 from bwesterb/patch-2

tgl.h: add stdlib.h include
Merge pull request #304 from bwesterb/patch-1

README: update instructions for MacPorts
Merge pull request #311 from mapio/master

Bumped readline version (for homebrew on OSX)
Merge github.com:vysheng/tg

Conflicts:
	tgl.h
Merge github.com:vysheng/tg
write secret chat file more frequent
Updates to event-old.h
Added more write_secret_chat_file calls
Workaround for iphone bug
tg: interface.c: alphabetical rearrangement of available commands
Merge github.com:vysheng/tg
Merge pull request #321 from streambinder/patch-1

tg: interface.c: alphabetical rearrangement of available commands
Added partial support for action resend. Fix crush on incorrect encrypted message in lua mode
Merge github.com:vysheng/tg
Minor fixes